From 547910f7013c14c1a3b6d0ef448e7879eb9efc09 Mon Sep 17 00:00:00 2001 From: Eric Hameleers Date: Wed, 2 Dec 2015 23:07:04 +0100 Subject: Fix the broken implementation of custom default runlevel. --- make_slackware_live.sh | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/make_slackware_live.sh b/make_slackware_live.sh index 01ae51d..cdf3373 100755 --- a/make_slackware_live.sh +++ b/make_slackware_live.sh @@ -401,7 +401,7 @@ EOT # Action! # --------------------------------------------------------------------------- -while getopts "d:efhm:r:s:t:vHR" Option +while getopts "d:efhm:r:s:t:vHR:" Option do case $Option in h ) cat <<-"EOH" @@ -453,7 +453,7 @@ do ;; H ) LIVE_HOSTNAME="${OPTARG}" ;; - R ) RUNLEVEL="${OPTARG}" + R ) RUNLEVEL=${OPTARG} ;; * ) echo "You passed an illegal switch to the program!" echo "Run '$0 -h' for more help." @@ -474,8 +474,13 @@ shift $(($OPTIND - 1)) # ----------------------------------------------------------------------------- if [ -n "$REFRESH" -a "$FORCE" = "YES" ]; then - echo "Please use only _one_ of the switches '-f' or '-r'!" - echo "Run '$0 -h' for more help." + echo ">> Please use only _one_ of the switches '-f' or '-r'!" + echo ">> Run '$0 -h' for more help." + exit 1 +fi + +if [ $RUNLEVEL -ne 3 -a $RUNLEVEL -ne 4 ]; then + echo ">> Default runlevel other than 3 or 4 is not supported." exit 1 fi @@ -989,7 +994,7 @@ else fi # Configure the default runlevel: -sed -i ${LIVE_ROOTDIR}/etc/inittab -e "s/\(id:\)3\(:initdefault:\)/\1${RUNLEVEL}\2/" +sed -i ${LIVE_ROOTDIR}/etc/inittab -e "s/\(id:\).\(:initdefault:\)/\1${RUNLEVEL}\2/" # Disable unneeded services: [ -f ${LIVE_ROOTDIR}/etc/rc.d/rc.acpid ] && chmod -x ${LIVE_ROOTDIR}/etc/rc.d/rc.acpid -- cgit v1.2.3