Debian Codegraph @

debian/src/initscripts/etc/init.d/reboot

raw
1 #! /bin/sh
2 ### BEGIN INIT INFO
3 # Provides: reboot
4 # Required-Start:
5 # Required-Stop:
6 # Default-Start:
7 # Default-Stop: 6
8 # Short-Description: Execute the reboot command.
9 # Description:
10 ### END INIT INFO
11
12 PATH=/usr/sbin:/usr/bin:/sbin:/bin
13
14 . /lib/lsb/init-functions
15 [ -f /etc/default/halt ] && . /etc/default/halt
16
17 do_stop() {
18 # Message should end with a newline since kFreeBSD may
19 # print more stuff (see #323749)
20 log_action_msg "Will now restart"
21 local netdown="-i"
22 if [ "${NETDOWN}" = no ]; then
23 netdown=""
24 fi
25 reboot -d -f ${netdown}
26 }
27
28 case "$1" in
29 start)
30 # No-op
31 ;;
32 restart | reload | force-reload)
33 echo "Error: argument '$1' not supported" >&2
34 exit 3
35 ;;
36 stop)
37 do_stop
38 ;;
39 status)
40 exit 0
41 ;;
42 *)
43 echo "Usage: $0 start|stop" >&2
44 exit 3
45 ;;
46 esac