21 lines
400 B
Go
21 lines
400 B
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
"os/exec"
|
|
)
|
|
|
|
func WgUp(config *Config) {
|
|
exec.Command("wg-quick", "up", config.Name).Output()
|
|
Notify("Success", fmt.Sprintf("%s is up!", config.Name))
|
|
}
|
|
|
|
func WgDown(config *Config) {
|
|
exec.Command("wg-quick", "down", config.Name).Output()
|
|
Notify("Success", fmt.Sprintf("%s is down!", config.Name))
|
|
}
|
|
|
|
func WgDownUp(config *Config) {
|
|
WgDown(config)
|
|
WgUp(config)
|
|
}
|