44 lines
955 B
Plaintext
44 lines
955 B
Plaintext
|
|
#!/bin/bash
|
||
|
|
|
||
|
|
### BEGIN INIT INFO
|
||
|
|
# Provides: reboot
|
||
|
|
# Required-Start:
|
||
|
|
# Required-Stop:
|
||
|
|
# Default-Start:
|
||
|
|
# Default-Stop:
|
||
|
|
# Short-Description:
|
||
|
|
# Description: Setup reboot platform environment
|
||
|
|
### END INIT INFO
|
||
|
|
|
||
|
|
case "$1" in
|
||
|
|
start)
|
||
|
|
if [ -e "/oem/rockchip_test/auto_reboot.sh" ]; then
|
||
|
|
echo "start recovery auto-reboot"
|
||
|
|
mkdir -p /data/cfg/rockchip_test
|
||
|
|
cp /oem/rockchip_test/auto_reboot.sh /data/cfg/rockchip_test/
|
||
|
|
fi
|
||
|
|
|
||
|
|
if [ -e "/data/cfg/rockchip_test/power_lost_test.sh" ]; then
|
||
|
|
echo "start test flash power lost"
|
||
|
|
source /data/cfg/rockchip_test/power_lost_test.sh &
|
||
|
|
fi
|
||
|
|
if [ -e "/data/cfg/rockchip_test/auto_reboot.sh" ]; then
|
||
|
|
echo "start auto-reboot"
|
||
|
|
source /data/cfg/rockchip_test/auto_reboot.sh `cat /data/cfg/rockchip_test/reboot_total_cnt`&
|
||
|
|
fi
|
||
|
|
|
||
|
|
;;
|
||
|
|
stop)
|
||
|
|
echo "stop auto-reboot finished"
|
||
|
|
;;
|
||
|
|
restart|reload)
|
||
|
|
$0 stop
|
||
|
|
$0 start
|
||
|
|
;;
|
||
|
|
*)
|
||
|
|
echo "Usage: $0 {start|stop|restart}"
|
||
|
|
exit 1
|
||
|
|
esac
|
||
|
|
|
||
|
|
exit 0
|