From 271c68800dc5d0a2a370dfc98585f987cd72d47e Mon Sep 17 00:00:00 2001 From: Rene Rebe Date: Wed, 20 Aug 2003 18:44:34 +0000 Subject: [PATCH] oops yet another forgotten part of: added a STONE module to change the default init runlevel git-svn-id: http://www.rocklinux.org/svn/rock-linux/trunk@1143 c5f82cb5-29bc-0310-9cd0-bff59a50e3bc --- package/base/sysvinit/stone_mod_init.sh | 54 +++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 package/base/sysvinit/stone_mod_init.sh diff --git a/package/base/sysvinit/stone_mod_init.sh b/package/base/sysvinit/stone_mod_init.sh new file mode 100644 index 000000000..b5cb2c54b --- /dev/null +++ b/package/base/sysvinit/stone_mod_init.sh @@ -0,0 +1,54 @@ +# --- ROCK-COPYRIGHT-NOTE-BEGIN --- +# +# This copyright note is auto-generated by ./scripts/Create-CopyPatch. +# Please add additional copyright information _after_ the line containing +# the ROCK-COPYRIGHT-NOTE-END tag. Otherwise it might get removed by +# the ./scripts/Create-CopyPatch script. Do not edit this copyright text! +# +# ROCK Linux: rock-src/package/base/gpm/stone_mod_gpm.sh +# ROCK Linux is Copyright (C) 1998 - 2003 Clifford Wolf +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. A copy of the GNU General Public +# License can be found at Documentation/COPYING. +# +# Many people helped and are helping developing ROCK Linux. Please +# have a look at http://www.rocklinux.org/ and the Documentation/TEAM +# file for details. +# +# --- ROCK-COPYRIGHT-NOTE-END --- +# +# [MAIN] 85 init System Init Configuration + +write_config() { + cp /etc/inittab{,.new} + sed s/.:initdefault/$rl:initdefault/ /etc/inittab.new > /etc/inittab + rm -f /etc/inittab.new +} + +set_rl() { + gui_menu default_runlevel "Select the default runlevel (Current: $rl)" \ + '1 ... Single user mode' 'rl=1' \ + '2 ... Multi user mode without network' 'rl=2' \ + '3 ... Multi user mode (normal operation)' 'rl=3' \ + '4 ... Custom use' 'rl=4' \ + '5 ... Multi user mode with graphical loging manager' 'rl=5' + + write_config +} + +main() { + while + rl=`grep initdefault /etc/inittab | cut -d : -f2` + + gui_menu gpm 'System Init Configuration. +Select an item to change the value:' \ + "Default runlevel... $rl" 'set_rl' \ + '' '' \ + 'Edit the /etc/inittab file' \ + "gui_edit 'The inittab file' /etc/inittab" + do : ; done +} +