2023-05-18 16:24:05 -05:00
|
|
|
#!/bin/bash
|
|
|
|
|
2024-03-04 12:53:00 -06:00
|
|
|
function SafeReboot() {
|
2023-05-18 16:24:05 -05:00
|
|
|
sync ; sync
|
|
|
|
sudo umount -fa > /dev/null 2&>1
|
|
|
|
|
2024-03-04 12:53:00 -06:00
|
|
|
# Turn off watchdog monitor gpio for correct reboot-cause
|
|
|
|
sudo echo 1 > /sys/class/gpio/gpio41/value
|
|
|
|
cat /sys/bus/i2c/devices/0-0041/last_reset_cause > /dev/null 2&>1
|
|
|
|
exec /sbin/reboot
|
2023-05-18 16:24:05 -05:00
|
|
|
}
|
|
|
|
|
2024-03-04 12:53:00 -06:00
|
|
|
SafeReboot
|