Files
initscripts/SRC/initscripts/init.d/rc
Jay Larson 3112172beb This package has gone through significant changes:
* Re-wrote/cleaned up init scripts
  * Re-wrote init-functions
  * Moved some things (init scripts, defaults, configs) to other packages
  * Added update-rc which manages /etc/rc* directories
  * Added usher to manage defaults
2017-05-16 16:44:05 -05:00

59 lines
1.2 KiB
Bash
Executable File

#!/bin/sh
. /lib/lsb/init-functions
trap "" INT QUIT TSTP
print_snap() {
echo "
_ _
| (_)
___ _ __ __ _ _ __ | |_ _ __ _ _ _ _
/ __| '_ \ / _' | '_ \| | | '_ \| | | \ \/ /
\__ \ | | | (_| | |_) | | | | | | |_| |> <
|___/_| |_|\__,_| .__/|_|_|_| |_|\__,_/_/\_\
| |
|_|
A GNU/Linux System
"
}
case "$1" in
S|1|2|3|4|5|6|0)
if [ "$RUNLEVEL" == "S" ]; then
set -a
[ -r /etc/default/rcS ] && . /etc/default/rcS
set +a
dmesg -n "${LOGLEVEL:-7}"
print_snap
fi
if [ "$PREVLEVEL" != "N" ]; then
for script in $(ls /etc/rc${RUNLEVEL}.d/K* 2>/dev/null); do
name=${script#/etc/rc${RUNLEVEL}.d/S[0-9][0-9]}
prevscript="/etc/rc${PREVLEVEL}.d/S[0-9][0-9]$name"
[ -f $prevscript ] && continue
$script stop
done
fi
for script in $(ls /etc/rc${RUNLEVEL}.d/S* 2>/dev/null); do
name=${script#/etc/rc${RUNLEVEL}.d/S[0-9][0-9]}
prevscript="/etc/rc${PREVLEVEL}.d/S[0-9][0-9]$name"
[ -f $prevscript ] && continue
$script start
done
;;
*)
echo "Usage: $0 <RUNLEVEL>"
exit 1
;;
esac