summaryrefslogtreecommitdiffstats
path: root/make_slackware_live.sh
diff options
context:
space:
mode:
author Eric Hameleers <alien@slackware.com>2015-12-02 23:07:04 +0100
committer Eric Hameleers <alien@slackware.com>2015-12-02 23:07:04 +0100
commit547910f7013c14c1a3b6d0ef448e7879eb9efc09 (patch)
tree3fcde4c64fbcc52339d2ff1181e9501d47603234 /make_slackware_live.sh
parent825df618b69bdb20716c2b4a6922ba21ec8116e6 (diff)
downloadliveslak-547910f7013c14c1a3b6d0ef448e7879eb9efc09.tar.gz
liveslak-547910f7013c14c1a3b6d0ef448e7879eb9efc09.tar.xz
Fix the broken implementation of custom default runlevel.
Diffstat (limited to 'make_slackware_live.sh')
-rwxr-xr-xmake_slackware_live.sh15
1 files 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