In Systemd, runlevel returns "unknown" and generate errors. Use strings (but do not detect if the system is booting)
This commit is contained in:
4
check
4
check
@@ -18,12 +18,12 @@ fi
|
||||
|
||||
RUNLEVEL=`runlevel | cut -f 2 -d ' '`
|
||||
[ "x$RUNLEVEL" == "x" ] && RUNLEVEL=0
|
||||
if [ $RUNLEVEL -eq 0 ] || [ $RUNLEVEL -eq 6 ]; then
|
||||
if [ "$RUNLEVEL" == "0" ] || [ "$RUNLEVEL" == "6" ]; then
|
||||
echo "Arret ou reboot en cours : on sort"
|
||||
exit
|
||||
fi
|
||||
|
||||
if [ $RUNLEVEL -eq 1 ]; then
|
||||
if [ "$RUNLEVEL" == "1" ]; then
|
||||
echo "Démarrage en cours : on sort"
|
||||
exit
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user