Skip to content

Commit

Permalink
shutdown: add -r for reboot
Browse files Browse the repository at this point in the history
  • Loading branch information
anzz1 committed Jun 18, 2023
1 parent c55f403 commit 20eb816
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 8 deletions.
1 change: 1 addition & 0 deletions extras/Tools/OTA Update.pak/launch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ progress 100 "Rebooting ..."
sleep 2
progress quit

shutdown -r
while true; do
sync && reboot && sleep 10
done
14 changes: 9 additions & 5 deletions skeleton/.system/bin/shutdown
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,21 @@ fatality() {
}

if [ "$0" = "/tmp/_shutdown" ]; then
killall telnetd ftpd tcpsvd main updater runtime.sh launch.sh
killall telnetd ftpd tcpsvd main keymon MainUI updater runtime.sh launch.sh
fatality
sync
umount -r /mnt/SDCARD
killall -9 telnetd ftpd tcpsvd main updater runtime.sh launch.sh
killall -9 telnetd ftpd tcpsvd main keymon MainUI updater runtime.sh launch.sh
fatality -9
sync
umount /mnt/SDCARD
while true; do
sync
poweroff
if [ "$1" = "-r" ]; then
reboot
else
poweroff
fi
sleep 10
done
fi
Expand All @@ -44,12 +48,12 @@ export PATH=/bin:/sbin:/usr/bin:/usr/sbin
if [ ! -z "$DATETIME_PATH" ]; then
date -u +%s > "$DATETIME_PATH"
fi
rm -f /tmp/miniui_exec
rm -f /tmp/miniui_exec /tmp/next
sync
if [ ! -f /tmp/_shutdown ]; then
cp -f /mnt/SDCARD/.system/bin/shutdown /tmp/_shutdown
fi
pgrep -f /tmp/_shutdown || (set -m; /tmp/_shutdown </dev/null >/dev/null 2>&1 &)
pgrep -f /tmp/_shutdown || (set -m; /tmp/_shutdown $1 </dev/null >/dev/null 2>&1 &)
while true; do
sleep 10
done
4 changes: 3 additions & 1 deletion skeleton/.system/paks/MiniUI.pak/launch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -115,4 +115,6 @@ while [ -f "$EXEC_PATH" ]; do
done

shutdown
poweroff # just in case
while true; do
sync && poweroff && sleep 10
done
3 changes: 1 addition & 2 deletions skeleton/.tmp_update/runtime.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,5 @@ if [ -f "$LAUNCH_PATH" ]; then
fi

while true; do
reboot
sleep 10
sync && reboot && sleep 10
done

0 comments on commit 20eb816

Please sign in to comment.