mirror of
https://github.com/edgebox-iot/edgeboxctl.git
synced 2026-09-25 06:13:03 +02:00
GetPath improvements (#20)
* Use named variables for getting path Fixed bug with env var * Fix test * Use utils to get paths
This commit is contained in:
@@ -329,14 +329,15 @@ func ExecuteSchedules(tick int) {
|
||||
func taskSetupTunnel(args taskSetupTunnelArgs) string {
|
||||
fmt.Println("Executing taskSetupTunnel")
|
||||
|
||||
wsPath := utils.GetPath(utils.WsPath)
|
||||
cmdargs := []string{"gen", "--name", args.NodeName, "--token", args.BootnodeToken, args.BootnodeAddress + ":8655", "--prefix", args.AssignedAddress}
|
||||
utils.Exec(utils.GetPath("wsPath"), "tinc-boot", cmdargs)
|
||||
utils.Exec(wsPath, "tinc-boot", cmdargs)
|
||||
|
||||
cmdargs = []string{"start", "tinc@dnet"}
|
||||
utils.Exec(utils.GetPath("wsPath"), "systemctl", cmdargs)
|
||||
utils.Exec(wsPath, "systemctl", cmdargs)
|
||||
|
||||
cmdargs = []string{"enable", "tinc@dnet"}
|
||||
utils.Exec(utils.GetPath("wsPath"), "systemctl", cmdargs)
|
||||
utils.Exec(wsPath, "systemctl", cmdargs)
|
||||
|
||||
output := "OK" // Better check / logging of command execution result.
|
||||
return output
|
||||
|
||||
Reference in New Issue
Block a user