aboutsummaryrefslogtreecommitdiffstats
path: root/event.d/rcS-sulogin
diff options
context:
space:
mode:
Diffstat (limited to 'event.d/rcS-sulogin')
-rw-r--r--event.d/rcS-sulogin13
1 files changed, 3 insertions, 10 deletions
diff --git a/event.d/rcS-sulogin b/event.d/rcS-sulogin
index ba5eea2e..5125fc41 100644
--- a/event.d/rcS-sulogin
+++ b/event.d/rcS-sulogin
@@ -12,14 +12,7 @@ script
runlevel --set S >/dev/null || true
/bin/bash
- if [ -r /etc/inittab ]; then
- RL="$(sed -n -e "/^id:[0-9]*:initdefault:/{s/^id://;s/:.*//;p}" /etc/inittab || true)"
- if [ -n "$RL" ]; then
- telinit $RL
- else
- telinit 2
- fi
- else
- telinit 2
- fi
+ runlevel=$(/bin/awk -F ':' '/^id:/ { print $2 }' /etc/inittab)
+ [ -z "$runlevel" ] && runlevel="3"
+ telinit $runlevel
end script