Compare commits
1 Commits
708480f03f
...
0a660e466f
Author | SHA1 | Date |
---|---|---|
Paulo Truta | 0a660e466f |
|
@ -530,7 +530,6 @@ func ExecuteSchedules(tick int) {
|
||||||
|
|
||||||
log.Println("Fetching Browser Dev Environment Information")
|
log.Println("Fetching Browser Dev Environment Information")
|
||||||
taskGetBrowserDevPassword()
|
taskGetBrowserDevPassword()
|
||||||
taskGetBrowserDevStatus()
|
|
||||||
|
|
||||||
ip := taskGetSystemIP()
|
ip := taskGetSystemIP()
|
||||||
log.Println("System IP is: " + ip)
|
log.Println("System IP is: " + ip)
|
||||||
|
@ -609,9 +608,7 @@ func ExecuteSchedules(tick int) {
|
||||||
|
|
||||||
if tick%3600 == 0 {
|
if tick%3600 == 0 {
|
||||||
// Executing every 3600 ticks (1 hour)
|
// Executing every 3600 ticks (1 hour)
|
||||||
taskGetBrowserDevStatus()
|
|
||||||
taskCheckSystemUpdates()
|
taskCheckSystemUpdates()
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if tick%86400 == 0 {
|
if tick%86400 == 0 {
|
||||||
|
@ -1138,26 +1135,6 @@ func taskStopShell() string {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func taskGetBrowserDevStatus() string {
|
|
||||||
fmt.Println("Executing taskGetBrowserDevStatus")
|
|
||||||
|
|
||||||
// Read status from systemctl status code-server@root
|
|
||||||
browserDevStatus := utils.Exec(
|
|
||||||
utils.GetPath(utils.WsPath),
|
|
||||||
"sh",
|
|
||||||
[]string{"-c", "systemctl --quiet is-active code-server@root && echo 'active' || echo 'inactive'"},
|
|
||||||
)
|
|
||||||
if browserDevStatus != "" {
|
|
||||||
fmt.Println("Browser Dev Environment is running")
|
|
||||||
utils.WriteOption("BROWSERDEV_STATUS", "running")
|
|
||||||
return "{\"status\": \"running\"}"
|
|
||||||
} else {
|
|
||||||
fmt.Println("Browser Dev Environment is not running")
|
|
||||||
utils.WriteOption("BROWSERDEV_STATUS", "not_running")
|
|
||||||
return "{\"status\": \"not_running\"}"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func taskActivateBrowserDev() string {
|
func taskActivateBrowserDev() string {
|
||||||
fmt.Println("Executing taskActivateBrowserDev")
|
fmt.Println("Executing taskActivateBrowserDev")
|
||||||
wsPath := utils.GetPath(utils.WsPath)
|
wsPath := utils.GetPath(utils.WsPath)
|
||||||
|
|
|
@ -54,7 +54,7 @@ func Exec(path string, command string, args []string) string {
|
||||||
// log.Println(fmt.Sprint(err) + ": " + stderr.String()) // ... Silence...
|
// log.Println(fmt.Sprint(err) + ": " + stderr.String()) // ... Silence...
|
||||||
}
|
}
|
||||||
|
|
||||||
log.Println("Result: " + out.String()) // ... Silence ...
|
// log.Println("Result: " + out.String()) // ... Silence ...
|
||||||
|
|
||||||
return strings.Trim(out.String(), " \n")
|
return strings.Trim(out.String(), " \n")
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue