* updated kmousetool (21.12.1 -> 21.12.2), untested
[t2-trunk.git] / package / base / sysfiles / etc_rc.d_rc.txt
blob83b2f7fe4e3fc806e646c7edcf24ac2c0830ad96
1 #!/bin/sh
2 # --- T2-COPYRIGHT-NOTE-BEGIN ---
3 # This copyright note is auto-generated by scripts/Create-CopyPatch.
4 #
5 # T2 SDE: package/.../sysfiles/etc_rc.d_rc.txt
6 # Copyright (C) 2004 - 2020 The T2 SDE Project
7 # Copyright (C) 1998 - 2003 ROCK Linux Project
8 #
9 # More information can be found in the files COPYING and README.
11 # This program is free software; you can redistribute it and/or modify
12 # it under the terms of the GNU General Public License as published by
13 # the Free Software Foundation; version 2 of the License. A copy of the
14 # GNU General Public License can be found in the file COPYING.
15 # --- T2-COPYRIGHT-NOTE-END ---
18 # ROCK Linux: /etc/rc.d/rc
20 # This script does the switching between runlevels.
24 export PATH=/bin:/sbin:/usr/bin:/usr/sbin
26 echo "** running rc script **"
27 echo "RC: Previous runlevel: $PREVLEVEL, new runlevel: $RUNLEVEL."
29 curdir=/etc/rc.d/rc$RUNLEVEL.d
30 prevdir=/etc/rc.d/rc$PREVLEVEL.d
33 # run the KILL scripts of the previous runlevel (if needed)
35 if ! [ $PREVLEVEL = S -o $PREVLEVEL = N ]
36 then
37 echo "RC: Leave runlevel $PREVLEVEL ..."
38 for i in $prevdir/K*; do
39 if ! test -x "$i" ; then
40 echo "Warning: $i is not executable: skipped."
41 continue
43 x="`echo "$i" | sed "s,$prevdir/K..,$curdir/S??,"`"
44 [ "`echo $x`" = "$x" ] || continue
45 /sbin/rc --nobtee $i stop
46 done
49 echo "RC: Enter runlevel $RUNLEVEL ..."
51 if [ $RUNLEVEL != 0 -a $RUNLEVEL != 6 -a $RUNLEVEL != S ]
52 then
54 # run the START scripts of the current (new) runlevel
56 for i in $curdir/S*; do
57 if ! test -x "$i" ; then
58 echo "Warning: $i is not executable: skipped."
59 continue
62 x="`echo "$i" | sed "s,$curdir/S..,$prevdir/K??,"`"
63 [ "`echo $x`" = "$x" ] || continue
64 /sbin/rc --nobtee $i start
65 done
68 echo "RC: The system is now in runlevel $RUNLEVEL."
70 # write EOT mark for btee
71 /bin/echo -ne '\004'
73 } 2>&1 | /sbin/btee a /var/log/init.msg
75 exit 0