xref: /OK3568_Linux_fs/debian/overlay-debug/rockchip-test/auto_reboot/auto_reboot_test.sh (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1#!/bin/bash
2
3case "$1" in
4	start)
5		if [ -e "/data/rockchip-test/auto_reboot.sh" ]; then
6			echo "start recovery auto-reboot"
7			mkdir -p /data/rockchip-test
8			cp /rockchip-test/auto_reboot/auto_reboot.sh /data/rockchip-test/
9		fi
10
11		if [ -e "/data/rockchip-test/power_lost_test.sh" ]; then
12			echo "start test flash power lost"
13			source /data/rockchip-test/power_lost_test.sh &
14		fi
15		if [ -e "/data/rockchip-test/auto_reboot.sh" ]; then
16			echo "start auto-reboot"
17			source /data/rockchip-test/auto_reboot.sh `cat /data/rockchip-test/reboot_total_cnt`&
18		fi
19
20		;;
21	stop)
22		echo "stop auto-reboot finished"
23		;;
24	restart|reload)
25		$0 stop
26		$0 start
27		;;
28	*)
29		echo "Usage: $0 {start|stop|restart}"
30		exit 1
31esac
32
33exit 0
34