PageRenderTime 66ms CodeModel.GetById 63ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

/init.d/single

http://github.com/brinkman83/bashrc
Shell | 35 lines | 21 code | 4 blank | 10 comment | 1 complexity | dc13cb373c5c098a8fb95424701373e3 MD5 | raw file
 1#! /bin/sh
 2### BEGIN INIT INFO
 3# Provides:          single
 4# Required-Start:    $local_fs $all killprocs
 5# Required-Stop:
 6# Default-Start:     1
 7# Default-Stop:
 8# Short-Description: executed by init(8) upon entering runlevel 1 (single).
 9### END INIT INFO
10
11PATH=/sbin:/bin
12
13. /lib/lsb/init-functions
14
15do_start () {
16	log_action_msg "Will now switch to single-user mode"
17	exec init -t1 S
18}
19
20case "$1" in
21  start)
22	do_start
23	;;
24  restart|reload|force-reload)
25	echo "Error: argument '$1' not supported" >&2
26	exit 3
27	;;
28  stop)
29	# No-op
30	;;
31  *)
32	echo "Usage: $0 start|stop" >&2
33	exit 3
34	;;
35esac