linuxOS_AP05/debian/test/etc/init.d/S99_auto_reboot
2025-09-26 09:40:02 +08:00

44 lines
955 B
Bash
Executable File

#!/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