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:
Malachi Soord
2022-10-08 18:41:37 +02:00
committed by GitHub
parent 83d2fdcae1
commit 0680b7ffb9
7 changed files with 56 additions and 54 deletions
+4 -3
View File
@@ -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