kill network manager
Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
parent
3869749fe2
commit
e503503fd5
|
@ -21,7 +21,7 @@ func main() {
|
||||||
log.Println("device /dev/mmcblk0p2 exists")
|
log.Println("device /dev/mmcblk0p2 exists")
|
||||||
} else {
|
} else {
|
||||||
log.Println("device /dev/mmcblk0p2 does not exist")
|
log.Println("device /dev/mmcblk0p2 does not exist")
|
||||||
// fail()
|
fail()
|
||||||
}
|
}
|
||||||
|
|
||||||
shell.Run("mount /dev/mmcblk0p2 /home/factory")
|
shell.Run("mount /dev/mmcblk0p2 /home/factory")
|
||||||
|
@ -29,27 +29,22 @@ func main() {
|
||||||
imagename := "factory-2019-01-20"
|
imagename := "factory-2019-01-20"
|
||||||
fullname := "/home/factory/" + imagename
|
fullname := "/home/factory/" + imagename
|
||||||
|
|
||||||
if _, err := os.Stat(fullname); !os.IsNotExist(err) {
|
// if the image does not exist, try to wget it
|
||||||
|
if _, err := os.Stat(fullname); os.IsNotExist(err) {
|
||||||
log.Println("filename", fullname, "does not exist")
|
log.Println("filename", fullname, "does not exist")
|
||||||
shell.Run("cd /home/factory")
|
shell.Run("cd /home/factory")
|
||||||
shell.Run("wget -c " + "http://fire.lab.wit.com/factory/" + imagename)
|
shell.Run("wget -c " + "http://fire.lab.wit.com/factory/" + imagename)
|
||||||
}
|
}
|
||||||
|
|
||||||
if _, err := os.Stat(fullname); !os.IsNotExist(err) {
|
if _, err := os.Stat(fullname); !os.IsNotExist(err) {
|
||||||
log.Println("filename", fullname, "exists. dd here")
|
log.Println("filename", fullname, "exists. dd here")
|
||||||
shell.Run("dd " + fullname + " of=/dev/mmcblk2 bs=1M status=progress oflag=sync")
|
shell.Run("dd " + fullname + " of=/dev/mmcblk2 bs=1M status=progress oflag=sync")
|
||||||
|
succeeded()
|
||||||
} else {
|
} else {
|
||||||
log.Println("filename", fullname, "does not exist")
|
log.Println("filename", fullname, "does not exist")
|
||||||
fail()
|
fail()
|
||||||
}
|
}
|
||||||
|
|
||||||
// wget -c http://fire.lab.wit.com/factory/
|
|
||||||
/*
|
|
||||||
echo dd if=/home/factory/emmc.img.armbian of=/dev/mmcblk2
|
|
||||||
dd if=/home/factory/emmc.img.armbian of=/dev/mmcblk2 bs=1M status=progress oflag=sync
|
|
||||||
|
|
||||||
dialog --ascii-lines --msgbox "Flash Image Completed!" 10 70
|
|
||||||
*/
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func fail () {
|
func fail () {
|
||||||
|
@ -83,5 +78,8 @@ func succeeded () {
|
||||||
log.Println("")
|
log.Println("")
|
||||||
log.Println("")
|
log.Println("")
|
||||||
|
|
||||||
|
// try executing this from golang to see what happens
|
||||||
|
// dialog --ascii-lines --msgbox "Flash Image Completed!" 10 70
|
||||||
|
|
||||||
os.Exit(0)
|
os.Exit(0)
|
||||||
}
|
}
|
||||||
|
|
9
rc.local
9
rc.local
|
@ -12,6 +12,15 @@ echo STARTING PINEBOOK IMAGING IN 5 SECONDS
|
||||||
echo
|
echo
|
||||||
echo CONTROL-C TO STOP
|
echo CONTROL-C TO STOP
|
||||||
echo
|
echo
|
||||||
|
|
||||||
|
echo
|
||||||
|
echo Kill off network manager and wpa_supplicant
|
||||||
|
echo
|
||||||
|
|
||||||
|
systemctl stop NetworkManager.service
|
||||||
|
systemctl disable NetworkManager.service
|
||||||
|
systemctl stop wpa_supplicant.service
|
||||||
|
|
||||||
echo Connecting to wifi network WIT Public 2
|
echo Connecting to wifi network WIT Public 2
|
||||||
killall wpa_supplicant
|
killall wpa_supplicant
|
||||||
ifconfig wlan0 up
|
ifconfig wlan0 up
|
||||||
|
|
Loading…
Reference in New Issue