You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
49 lines
867 B
49 lines
867 B
#!/bin/sh
|
|
|
|
touch /tmp/norestart
|
|
|
|
if [ -e /var/etc/.coredump ]; then
|
|
ulimit -c unlimited
|
|
fi
|
|
|
|
until neutrino; do
|
|
RET=$?
|
|
|
|
# shutdown
|
|
if [ $RET -eq 1 ]; then
|
|
touch /tmp/.halt
|
|
break
|
|
fi
|
|
|
|
echo "Neutrino exited with exit code $RET"
|
|
dt -t"NEUTRINO: $RET"
|
|
|
|
if [ -e /tmp/.lcd-usbdev?.? ]; then
|
|
echo "0" > /tmp/lcd/mode_logo
|
|
echo "Neutrino" > /tmp/lcd/service
|
|
echo "Error: $RET" > /tmp/lcd/event
|
|
fi
|
|
|
|
while [ -e /tmp/norestart ]; do # for debugging: stop the restart loop
|
|
sleep 1;
|
|
done
|
|
done
|
|
|
|
if [ -e /tmp/.reboot ]; then # gets created by neutrino
|
|
dt -t" ..REBOOT.."
|
|
reboot
|
|
elif [ -e /tmp/.halt ]; then
|
|
dt -t"SHUTDOWN"
|
|
|
|
TIMER="/tmp/.timer"
|
|
if [ -e $TIMER ]; then
|
|
# custom poweroff binary
|
|
if type shutdown_helper > /dev/null; then
|
|
PARAM=`cat $TIMER`
|
|
echo "calling 'shutdown_helper "$PARAM"'"
|
|
shutdown_helper $PARAM
|
|
fi
|
|
fi
|
|
|
|
poweroff
|
|
fi
|
|
|