diff --git a/connect-to-wifi/main.go b/connect-to-wifi/main.go index 81944fa..0b27dac 100644 --- a/connect-to-wifi/main.go +++ b/connect-to-wifi/main.go @@ -23,12 +23,22 @@ func dhclient() { for { log.Println("need to check the status of wpa_supplicant and dhclient here") - time.Sleep(5000 * time.Millisecond) // check every few seconds + time.Sleep(1000 * time.Millisecond) } } func main() { parseConfig() - dhclient() + go dhclient() + + for { + time.Sleep(1000 * time.Millisecond) + ping := shell.Run("ping -c 1 localhost") + log.Println("ping returned ", ping) + if (ping == 0) { + break + } + } + shell.Run("/root/go/bin/get-image") } diff --git a/get-image/test/main.go b/get-image/test/main.go new file mode 100644 index 0000000..0468c1d --- /dev/null +++ b/get-image/test/main.go @@ -0,0 +1,15 @@ +package main + +import "os" +import "log" + +import "git.wit.com/jcarr/shell" + +func main() { + shell.Run("dialog --ascii-lines --msgbox 'Flash_Image_Completed' 10 70") + + log.Println("INSTALL SUCCEEDED") + log.Println("INSTALL SUCCEEDED") + + os.Exit(0) +} diff --git a/get-image/test/test b/get-image/test/test new file mode 100755 index 0000000..91000bc Binary files /dev/null and b/get-image/test/test differ