aboutsummaryrefslogtreecommitdiff
blob: ae4a2e19e9674b37a82b7362fb1e6ad54cad1674 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/sbin/runscript
# Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$

extra_commands="mark_for_reboot"

STATEFILE=/force_reboot_shutdown

depend() {
	if [ -x /etc/init.d/root ]; then
		need root
	else
		need checkroot
	fi
}

start() {
	# check weather this time this is a reboot and I should shutdown
	
	if [ -e "${STATEFILE}" ]; then
		rm -f "${STATEFILE}"
		einfo "This is a reboot to write the wakeup-time into the bios."
		einfo "Shutting down now."
		init 0
	fi
}

stop() {
	:
}

mark_for_reboot() {
	touch "${STATEFILE}"
}