setup_init don't find runlevel
Brought to you by:
jtsiomb
On my suse linux the script setup_init find three lines:
5
# runlevel 0 is System halt (Do not use this for initdefault!)
# runlevel 6 is System reboot (Do not use this for initdefault!)
That case an error.
Please don't use
rlvl=`cat /etc/inittab | grep initdefault | sed 's/^id://; s/:init.*$//'`
use instead:
rlvl=`cat /etc/inittab | grep ^id:.:initdefault | sed 's/^id://; s/:init.*$//'`
Now comments are ignored and only the line starting with "id:" followed by one character and ":initdefault" will be identified.
I also add an setup_sysv_suse_init() because suse 11 has the rc5.d directory inside /etc/rc.d/
I also check if I can change to the runlevel directory and exit with error if it doesn't work
patched setup_init for suse