diff options
Diffstat (limited to 'rc.d')
-rwxr-xr-x | rc.d/init.d/functions | 128 | ||||
-rwxr-xr-x | rc.d/init.d/halt | 21 | ||||
-rwxr-xr-x | rc.d/init.d/netfs | 30 | ||||
-rwxr-xr-x | rc.d/init.d/network | 30 | ||||
-rwxr-xr-x | rc.d/init.d/random | 6 | ||||
-rwxr-xr-x | rc.d/init.d/rawdevices | 24 | ||||
-rwxr-xr-x | rc.d/init.d/single | 11 | ||||
-rwxr-xr-x | rc.d/rc | 14 | ||||
-rwxr-xr-x | rc.d/rc.sysinit | 59 |
9 files changed, 193 insertions, 130 deletions
diff --git a/rc.d/init.d/functions b/rc.d/init.d/functions index ac112eb3..03ec4ce5 100755 --- a/rc.d/init.d/functions +++ b/rc.d/init.d/functions @@ -8,6 +8,11 @@ # Author: Miquel van Smoorenburg, <miquels@drinkel.nl.mugnet.org> # Hacked by: Greg Galloway and Marc Ewing # +# +# i18n originally by: Arnaldo Carvalho de Melo <acme@conectiva.com.br>, +# Wanderlei Antonio Cavassin +TEXTDOMAIN=initscripts +TEXTDOMAINDIR=/etc/locale # First set up a default search path. export PATH="/sbin:/usr/sbin:/bin:/usr/bin:/usr/X11R6/bin" @@ -49,6 +54,49 @@ else INITLOG_ARGS= fi +if [ -z "$GP_LANG" -a -f /etc/sysconfig/i18n ]; then + GP_LANG=$(sed -n 's/"//g ; s/^LANG=//p' /etc/sysconfig/i18n ) +fi + +gprintf() { + if [ -x /usr/bin/gettext ]; then + local TEXT=`LC_MESSAGES=$GP_LANG gettext -e --domain=$TEXTDOMAIN "$1"` + else + local TEXT=$1 + fi + [ "${1#*\\n}" ] || TEXT="$TEXT\n" + shift + printf "$TEXT" "$@" +} + +# Frontend to gprintf (support up to 4 %s in format string) +# returns the message transleted in GPRINTF_MSG and +# the resting parms in GPRINTF_REST +# This simplifies a lot the call of functions like action, +# now with i18n support +gprintf_msg_rest() { +case "$1" in + *%s*%s*%s*%s*) + GPRINTF_MSG=$(gprintf "$1" "$2" "$3" "$4" "$5") + shift 5;; + *%s*%s*%s*) + GPRINTF_MSG=$(gprintf "$1" "$2" "$3" "$4") + shift 4;; + *%s*%s*) + GPRINTF_MSG=$(gprintf "$1" "$2" "$3") + shift 3;; + *%s*) + GPRINTF_MSG=$(gprintf "$1" "$2") + shift 2;; + *) + GPRINTF_MSG=$(gprintf "$1") + shift;; +esac +GPRINTF_REST="$@" +} + + + # Check if $pid (could be plural) are running checkpid() { while [ "$1" ]; do @@ -67,7 +115,7 @@ daemon() { nicelevel=0 while [ "$1" != "${1##-}" -o "$1" != "${1##+}" ]; do case $1 in - '') echo '$0: Usage: daemon [+/-nicelevel] {program}' + '') gprintf "$0: Usage: daemon [+/-nicelevel] {program}\n" $0 return 1;; --check) shift @@ -121,7 +169,7 @@ killproc() { RC=0 # Test syntax. if [ $# = 0 ]; then - echo "Usage: killproc {program} [signal]" + gprintf "Usage: killproc {program} [signal]\n" return 1 fi @@ -219,14 +267,14 @@ status() { # Test syntax. if [ $# = 0 ] ; then - echo "Usage: status {program}" + gprintf "Usage: status {program}\n" return 1 fi # First try "pidof" pid=`pidof -o $$ -o $PPID -o %PPID -x ${base}` if [ "$pid" != "" ] ; then - echo "${base} (pid $pid) is running..." + gprintf "%s (pid %s) is running...\n" "${base}" "$pid" return 0 fi @@ -234,16 +282,16 @@ status() { if [ -f /var/run/${base}.pid ] ; then pid=`cat /var/run/${base}.pid | { read foo ; echo $foo ; }` if [ "$pid" != "" ] ; then - echo "${base} dead but pid file exists" + gprintf "%s dead but pid file exists\n" "${base}" return 1 fi fi # See if /var/lock/subsys/${base} exists if [ -f /var/lock/subsys/${base} ]; then - echo "${base} dead but subsys locked" + gprintf "%s dead but subsys locked\n" "${base}" return 2 fi - echo "${base} is stopped" + gprintf "%s is stopped\n" "${base}" return 3 } @@ -251,7 +299,7 @@ echo_success() { [ "$BOOTUP" = "color" ] && $MOVE_TO_COL echo -n "[ " [ "$BOOTUP" = "color" ] && $SETCOLOR_SUCCESS - echo -n "OK" + gprintf "OK" [ "$BOOTUP" = "color" ] && $SETCOLOR_NORMAL echo -n " ]" echo -ne "\r" @@ -262,7 +310,7 @@ echo_failure() { [ "$BOOTUP" = "color" ] && $MOVE_TO_COL echo -n "[" [ "$BOOTUP" = "color" ] && $SETCOLOR_FAILURE - echo -n "FAILED" + gprintf "FAILED" [ "$BOOTUP" = "color" ] && $SETCOLOR_NORMAL echo -n "]" echo -ne "\r" @@ -273,7 +321,7 @@ echo_passed() { [ "$BOOTUP" = "color" ] && $MOVE_TO_COL echo -n "[" [ "$BOOTUP" = "color" ] && $SETCOLOR_WARNING - echo -n "PASSED" + gprintf "PASSED" [ "$BOOTUP" = "color" ] && $SETCOLOR_NORMAL echo -n "]" echo -ne "\r" @@ -282,11 +330,13 @@ echo_passed() { # Log that something succeeded success() { + gprintf_msg_rest "$@" if [ -z "$IN_INITLOG" ]; then - initlog $INITLOG_ARGS -n $0 -s "$1" -e 1 + initlog $INITLOG_ARGS -n $0 -s "$GPRINTF_MSG" -e 1 else # silly hack to avoid EPIPE killing rc.sysinit trap "" SIGPIPE +# FIXME? echo "$INITLOG_ARGS -n $0 -s \"$1\" -e 1" >&21 trap - SIGPIPE fi @@ -297,11 +347,12 @@ success() { # Log that something failed failure() { rc=$? + gprintf_msg_rest "$@" if [ -z "$IN_INITLOG" ]; then - initlog $INITLOG_ARGS -n $0 -s "$1" -e 2 + initlog $INITLOG_ARGS -n $0 -s "$GPRINTF_MSG" -e 2 else trap "" SIGPIPE - echo "$INITLOG_ARGS -n $0 -s \"$1\" -e 2" >&21 + echo "-n $0 -s \"$GPRINTF_MSG\" -e 1" >&21 trap - SIGPIPE fi [ "$BOOTUP" != "verbose" ] && echo_failure @@ -311,10 +362,12 @@ failure() { # Log that something passed, but may have had errors. Useful for fsck passed() { rc=$? + gprintf_msg_rest "$@" if [ -z "$IN_INITLOG" ]; then - initlog $INITLOG_ARGS -n $0 -s "$1" -e 1 + initlog $INITLOG_ARGS -n $0 -s "$GPRINTF_MSG" -e 1 else trap "" SIGPIPE +#FIXME? echo "$INITLOG_ARGS -n $0 -s \"$1\" -e 1" >&21 trap - SIGPIPE fi @@ -324,32 +377,39 @@ passed() { # Run some action. Log its output. action() { - STRING=$1 - echo -n "$STRING " - shift - initlog $INITLOG_ARGS -c "$*" && success "$STRING" || failure "$STRING" + gprintf_msg_rest "$@" + echo -n "$GPRINTF_MSG " + initlog $INITLOG_ARGS -c "$GPRINTF_REST" && success "$GPRINTF_MSG" || failure "$GPRINTF_MSG" rc=$? echo return $rc } +# returns OK if $1 contains $2 +strstr() { + [ "$1" = "$2" ] && return 0 + slice=${1#*$2*} + [ "$slice" = "$1" ] && return 1 + return 0 +} + + # Confirm whether we really want to run this service confirm() { - echo -n "Start service $1 (Y)es/(N)o/(C)ontinue? [Y] " + gprintf "Start service %s (Y)es/(N)o/(C)ontinue? [Y] " $1 + local YES=`gprintf "yY"` + local NOT=`gprintf "nN"` + local CNT=`gprintf "cC"` + read answer - case $answer in - y|Y|"") - return 0 - ;; - c|C) - return 2 - ;; - n|N) - return 1 - ;; - *) - confirm $1 - return $? - ;; - esac + + if strstr "$YES" "$answer" || [ "$answer" = "" ] ; then + return 0 + elif strstr "$CNT" "$answer" ; then + return 2 + elif strstr "$NOT" "$answer" ; then + return 1 + fi + confirm $* + } diff --git a/rc.d/init.d/halt b/rc.d/init.d/halt index 362a4c5f..095b0e74 100755 --- a/rc.d/init.d/halt +++ b/rc.d/init.d/halt @@ -14,12 +14,13 @@ PATH=/sbin:/bin:/usr/bin:/usr/sbin . /etc/init.d/functions runcmd() { - echo -n "$1 " + gprintf_msg_rest "$@" + echo -n "$GPRINTF_MSG " shift if [ "$BOOTUP" = "color" ]; then - $* && echo_success || echo_failure + $GPRINTF_REST && echo_success || echo_failure else - $* + $GPRINTF_REST fi echo } @@ -27,15 +28,15 @@ runcmd() { # See how we were called. case "$0" in *halt) - message="The system is halted" + message=`gprintf "The system is halted"` command="halt" ;; *reboot) - message="Please stand by while rebooting the system..." + message=`gprintf "Please stand by while rebooting the system..."` command="reboot" ;; *) - echo "$0: call me as \"rc.halt\" or \"rc.reboot\" please!" + gprintf "%s: call me as 'halt' or 'reboot' please!" $0 exit 1 ;; esac @@ -43,9 +44,9 @@ esac # Kill all processes. [ "${BASH+bash}" = bash ] && enable kill -runcmd "Sending all processes the TERM signal..." /sbin/killall5 -15 +runcmd "Sending all processes the %s signal..." "TERM" /sbin/killall5 -15 sleep 5 -runcmd "Sending all processes the KILL signal..." /sbin/killall5 -9 +runcmd "Sending all processes the %s signal.." "KILL" /sbin/killall5 -9 # Write to wtmp file before unmounting /var halt -w @@ -100,9 +101,9 @@ runcmd "Unmounting proc file system: " umount /proc # Now halt or reboot. echo "$message" if [ -f /fastboot ]; then - echo "On the next boot fsck will be skipped." + gprintf "On the next boot fsck will be skipped.\n" elif [ -f /forcefsck ]; then - echo "On the next boot fsck will be forced." + gprintf "On the next boot fsck will be forced.\n" fi HALTARGS="-i -d" diff --git a/rc.d/init.d/netfs b/rc.d/init.d/netfs index fbb8ce64..3d18afd6 100755 --- a/rc.d/init.d/netfs +++ b/rc.d/init.d/netfs @@ -35,10 +35,10 @@ case "$1" in [ -n "$NFSFSTAB" ] && { [ ! -f /var/lock/subsys/portmap ] && service portmap start - action "Mounting NFS filesystems: " mount -a -t nfs + action "Mounting %s filesystems: " NFS mount -a -t nfs } - [ -n "$SMBFSTAB" ] && action "Mounting SMB filesystems: " mount -a -t smbfs - [ -n "$NCPFSTAB" ] && action "Mounting NCP filesystems: " mount -a -t ncpfs + [ -n "$SMBFSTAB" ] && action "Mounting %s filesystems: " SMB mount -a -t smbfs + [ -n "$NCPFSTAB" ] && action "Mounting %s filesystems: " NCP mount -a -t ncpfs touch /var/lock/subsys/netfs action "Mounting other filesystems: " mount -a -t nonfs,smbfs,ncpfs ;; @@ -50,9 +50,9 @@ case "$1" in while [ -n "$remaining" -a "$retry" -gt 0 ] do if [ "$retry" -lt 3 ]; then - action "Unmounting NFS filesystems (retry): " umount -f -a -t nfs + action "Unmounting %s filesystems (retry): " NFS umount -f -a -t nfs else - action "Unmounting NFS filesystems: " umount -f -a -t nfs + action "Unmounting %s filesystems: " NFS umount -f -a -t nfs fi sleep 2 remaining=`awk '!/^#/ && $3 ~ /^nfs/ && $2 != "/" {print $2}' /proc/mounts` @@ -63,38 +63,38 @@ case "$1" in sig=-9 done } - [ -n "$SMBMTAB" ] && action "Unmounting SMB filesystems: " umount -a -t smbfs - [ -n "$NCPMTAB" ] && action "Unmounting NCP filesystems: " umount -a -t ncpfs + [ -n "$SMBMTAB" ] && action "Unmounting %s filesystems: " SMB umount -a -t smbfs + [ -n "$NCPMTAB" ] && action "Unmounting %s filesystems: " NCP umount -a -t ncpfs rm -f /var/lock/subsys/netfs ;; status) if [ -f /proc/mounts ] ; then [ -n "$NFSFSTAB" ] && { - echo "Configured NFS mountpoints: " + gprintf "Configured %s mountpoints:\n" NFS for fs in $NFSFSTAB; do echo $fs ; done } [ -n "$SMBFSTAB" ] && { - echo "Configured SMB mountpoints: " + gprintf "Configured %s mountpoints:\n" SMB for fs in $SMBFSTAB; do echo $fs ; done } [ -n "$NCPFSTAB" ] && { - echo "Configured NCP mountpoints: " + gprintf "Configured %s mountpoints:\n" NCP for fs in $NCPFSTAB; do echo $fs ; done } [ -n "$NFSMTAB" ] && { - echo "Active NFS mountpoints: " + gprintf "Active %s mountpoints:\n" NFS for fs in $NFSMTAB; do echo $fs ; done } [ -n "$SMBMTAB" ] && { - echo "Active SMB mountpoints: " + gprintf "Active %s mountpoints:\n" SMB for fs in $SMBMTAB; do echo $fs ; done } [ -n "$NCPMTAB" ] && { - echo "Active NCP mountpoints: " + gprintf "Active %s mountpoints:\n" NCP for fs in $NCPMTAB; do echo $fs ; done } else - echo "/proc filesystem unavailable" + gprintf "/proc filesystem unavailable\n" fi ;; restart) @@ -105,7 +105,7 @@ case "$1" in $0 start ;; *) - echo "Usage: netfs {start|stop|restart|reload|status}" + gprintf "Usage: %s {start|stop|restart|reload|status}\n" netfs exit 1 esac diff --git a/rc.d/init.d/network b/rc.d/init.d/network index 6e348d52..46f84493 100755 --- a/rc.d/init.d/network +++ b/rc.d/init.d/network @@ -45,7 +45,7 @@ case "$1" in action "Setting network parameters: " sysctl -p /etc/sysctl.conf - action "Bringing up interface lo: " ./ifup ifcfg-lo + action "Bringing up interface %s: " lo ./ifup ifcfg-lo case "$IPX" in yes|true) @@ -94,7 +94,7 @@ case "$1" in for i in $interfaces ; do if LC_ALL= LANG= ifconfig $i 2>/dev/null | grep -q " UP " >/dev/null 2>&1 ; then - action "Shutting down interface $i: " ./ifdown $i boot + action "Shutting down interface %s: " $i ./ifdown $i boot fi done case "$IPX" in @@ -121,18 +121,18 @@ case "$1" in rm -f /var/lock/subsys/network ;; status) - echo "Configured devices:" + gprintf "Configured devices:\n" echo lo $interfaces if [ -x /sbin/linuxconf ] ; then eval `/sbin/linuxconf --hint netdev` - echo "Devices that are down:" + gprintf "Devices that are down:\n" echo $DEV_UP - echo "Devices with modified configuration:" + gprintf "Devices with modified configuration:\n" echo $DEV_RECONF else - echo "Currently active devices:" - echo `/sbin/ifconfig | grep ^[a-z] | awk '{print $1}'` + gprintf "Currently active devices:\n" + echo `LC_ALL= LANG= /sbin/ifconfig | grep ^[a-z] | awk '{print $1}'` fi ;; restart) @@ -144,26 +144,26 @@ case "$1" in if [ -x /sbin/linuxconf ] ; then eval `/sbin/linuxconf --hint netdev` for device in $DEV_UP ; do - action "Bringing up device $device: " ./ifup $device + action "Bringing up device %s: " $device ./ifup $device done for device in $DEV_DOWN ; do - action "Shutting down device $device: " ./ifdown $device + action "Shutting down device %s: " $device ./ifdown $device done for device in $DEV_RECONF ; do - action "Shutting down device $device: " ./ifdown $device - action "Bringing up device $device: " ./ifup $device + action "Shutting down device %s: " $device ./ifdown $device + action "Bringing up device %s: " $device ./ifup $device done for device in $DEV_RECONF_ALIASES ; do - action "Briging up alias $device: " /etc/sysconfig/network-scripts/ifup-aliases $device + action "Briging up alias %s: " $device /etc/sysconfig/network-scripts/ifup-aliases $device done for device in $DEV_RECONF_ROUTES ; do - action "Bringing up route $device: " /etc/sysconfig/network-scripts/ifup-routes $device + action "Bringing up route %s: " $device /etc/sysconfig/network-scripts/ifup-routes $device done case $IPX in yes|true) case $IPXINTERNALNET in reconf) action "Deleting internal IPX network: " /sbin/ipx_internal_net del - action "Adding internal IPX network $IPXINTERNALNETNUM $IPXINTERNALNODENUM: " /sbin/ipx_internal_net add $IPXINTERNALNETNUM \ + action "Adding internal IPX network %s %s: " $IPXINTERNALNETNUM $IPXINTERNALNODENUM /sbin/ipx_internal_net add $IPXINTERNALNETNUM \ $IPXINTERNALNODENUM ;; add) @@ -197,7 +197,7 @@ case "$1" in fi ;; *) - echo "Usage: network {start|stop|restart|reload|status|probe}" + gprintf "Usage: %s {start|stop|restart|reload|status|probe}\n" "network" exit 1 esac diff --git a/rc.d/init.d/random b/rc.d/init.d/random index 81c7a780..2eb95f66 100755 --- a/rc.d/init.d/random +++ b/rc.d/init.d/random @@ -41,9 +41,9 @@ case "$1" in status) # this is way overkill, but at least we have some status output... if [ -c /dev/random ] ; then - echo "The random data source exists" + gprintf "The random data source exists\n" else - echo "The random data source is missing" + gprintf "The random data source is missing\n" fi ;; restart|reload) @@ -53,7 +53,7 @@ case "$1" in *) # do not advertise unreasonable commands that there is no reason # to use with this device - echo "Usage: random {start|stop|status|restart|reload}" + gprintf "Usage: %s {start|stop|status|restart|reload}\n" "random" exit 1 esac diff --git a/rc.d/init.d/rawdevices b/rc.d/init.d/rawdevices index 2d883ef0..cb4152a2 100755 --- a/rc.d/init.d/rawdevices +++ b/rc.d/init.d/rawdevices @@ -13,6 +13,8 @@ # Source function library. . /etc/init.d/functions +TEXTDOMAIN=initscripts + [ -f /usr/bin/raw ] || exit 0 [ -f /etc/sysconfig/rawdevices ] || exit 0 @@ -26,17 +28,17 @@ function assign_raw() cat /etc/sysconfig/rawdevices | egrep -v '^ *#' | while read RAW BLOCK; do if [ -n "$RAW" -a -n "$BLOCK" ]; then if [ "`dirname $RAW`" = "/dev" -a -d /dev/raw ]; then - echo " Please correct your /etc/sysconfig/rawdevices:" - echo " rawdevices are now located in the directory /dev/raw/ " - echo " If the command 'raw' still refers to /dev/raw as a file." - echo " you'll have to upgrade your util-linux package" + gprintf " Please correct your /etc/sysconfig/rawdevices:\n" + gprintf " rawdevices are now located in the directory /dev/raw/\n" + gprintf " If the command 'raw' still refers to /dev/raw as a file.\n" + gprintf " you'll have to upgrade your util-linux package\n" exit 0 fi if [ "`dirname $RAW`" = "/dev/raw" -a -f /dev/raw ]; then - echo " Please correct your /etc/sysconfig/rawdevices:" - echo " rawdevices are now located in the directory /dev/raw/ " - echo " If the command 'raw' still refers to /dev/raw as a file." - echo " you'll have to upgrade your util-linux package" + gprintf " Please correct your /etc/sysconfig/rawdevices:\n" + gprintf " rawdevices are now located in the directory /dev/raw/\n" + gprintf " If the command 'raw' still refers to /dev/raw as a file.\n" + gprintf " you'll have to upgrade your util-linux package\n" exit 0 fi @@ -50,7 +52,7 @@ function assign_raw() case "$1" in start) # Assign devices - echo "Assigning devices: " + gprintf "Assigning devices: " assign_raw echo "done" ;; @@ -63,7 +65,7 @@ case "$1" in if [ $ID -eq 0 ]; then raw -qa else - echo "You need to be root to use this command ! " + gprintf "You need to be root to use this command!\n" fi ;; @@ -72,7 +74,7 @@ case "$1" in ;; *) - echo "Usage: rawdevice {start|stop|status|restart}" + gprintf "Usage: rawdevice {start|stop|status|restart}\n" exit 1 esac diff --git a/rc.d/init.d/single b/rc.d/init.d/single index 6806d0c3..92de156e 100755 --- a/rc.d/init.d/single +++ b/rc.d/init.d/single @@ -10,10 +10,11 @@ # Modified for RHS Linux by Damien Neil # -. /etc/init.d/functions - # Set the path. PATH=/sbin:/bin:/usr/sbin:/usr/bin +TEXTDOMAIN=initscripts + +. /etc/rc.d/init.d/functions if [ "$1" != "start" ] ; then exit 0 @@ -22,10 +23,10 @@ fi # Kill all processes. [ "${BASH+bash}" = bash ] && enable kill -echo "Sending all processes the TERM signal..." +gprintf "Sending all processes the %s signal...\n" "TERM" kill -15 -1 sleep 5 -echo "Sending all processes the KILL signal.." +gprintf "Sending all processes the %s signal..\n" "KILL" kill -9 -1 rm -f /var/lock/subsys/* @@ -52,5 +53,5 @@ for i in /etc/rc1.d/S[0-9][0-9]*; do done # Now go to the single user level. -echo "Telling INIT to go to single user mode." +gprintf "Telling INIT to go to single user mode.\n" exec init -t1 S @@ -9,9 +9,6 @@ # Miquel van Smoorenburg, <miquels@drinkel.nl.mugnet.org> # -# Source function library. -. /etc/init.d/functions - # Now find out what the current and what the previous runlevel are. argv1="$1" set `/sbin/runlevel` @@ -19,15 +16,18 @@ runlevel=$2 previous=$1 export runlevel previous +# Source function library. +. /etc/init.d/functions + # See if we want to be in user confirmation mode if [ "$previous" = "N" ]; then if grep -i confirm /proc/cmdline >/dev/null || [ -f /var/run/confirm ] ; then rm -f /var/run/confirm CONFIRM=yes - echo "Entering interactive startup" + gprintf "Entering interactive startup\n" else CONFIRM= - echo "Entering non-interactive startup" + gprintf "Entering non-interactive startup\n" fi fi @@ -58,7 +58,7 @@ if [ -d /etc/rc$runlevel.d ]; then if egrep -q "(killproc |action )" $i ; then $i stop else - action "Stopping $subsys: " $i stop + action "Stopping %s: " $subsys $i stop fi done @@ -101,7 +101,7 @@ if [ -d /etc/rc$runlevel.d ]; then if [ "$subsys" = "halt" -o "$subsys" = "reboot" -o "$subsys" = "single" -o "$subsys" = "local" ]; then $i start else - action "Starting $subsys: " $i start + action "Starting %s: " $subsys $i start fi fi done diff --git a/rc.d/rc.sysinit b/rc.d/rc.sysinit index 30124250..f4fe64de 100755 --- a/rc.d/rc.sysinit +++ b/rc.d/rc.sysinit @@ -34,14 +34,13 @@ fi . /etc/init.d/functions # Print a banner. ;) -echo -en "\t\t\tWelcome to " +gprintf "\t\t\tWelcome to " [ "$BOOTUP" != "serial" ] && echo -en "\\033[1;31m" echo -en "Red Hat" [ "$BOOTUP" != "serial" ] && echo -en "\\033[0;39m" echo " Linux" if [ "$PROMPT" != "no" ]; then - echo -en "\t\tPress 'I' to enter interactive startup." - echo + gprintf "\t\tPress 'I' to enter interactive startup.\n" sleep 1 fi @@ -101,7 +100,7 @@ esac /sbin/hwclock $CLOCKFLAGS -action "Setting clock $CLOCKDEF: `date`" date +action "Setting clock %s: %s" "$CLOCKDEF" "`date`" date if [ "`/sbin/consoletype`" == "vt" ]; then # Load keymap @@ -121,9 +120,9 @@ if [ "`/sbin/consoletype`" == "vt" ]; then if [ -n "$KEYMAP" ]; then # Since this takes in/output from stdin/out, we can't use initlog if [ -n "$KEYTABLE" ]; then - echo -n "Loading default keymap ($KEYTABLE): " + gprintf "Loading default keymap (%s): " "$KEYTABLE" else - echo -n "Loading default keymap: " + gprintf "Loading default keymap: " fi loadkeys $KEYMAP < /dev/tty0 > /dev/tty0 2>/dev/null && \ success "Loading default keymap" || failure "Loading default keymap" @@ -138,7 +137,7 @@ if [ "`/sbin/consoletype`" == "vt" ]; then -f /usr/lib/kbd/consolefonts/$SYSFONT.psf.gz -o \ -f /etc/sysconfig/console/$SYSFONT.gz -o \ -f /usr/lib/kbd/consolefonts/$SYSFONT.gz ]; then - action "Setting default font ($SYSFONT): " /sbin/setsysfont + action "Setting default font (%s): " "$SYSFONT" /sbin/setsysfont fi fi fi @@ -147,7 +146,7 @@ fi action "Activating swap partitions: " swapon -a # Set the hostname. -action "Setting hostname ${HOSTNAME}: " hostname ${HOSTNAME} +action "Setting hostname %s: " "${HOSTNAME}" hostname ${HOSTNAME} # Initialize USB controller and HID devices usb=0 @@ -201,7 +200,7 @@ _RUN_QUOTACHECK=0 ROOTFSTYPE=`grep " / " /proc/mounts | awk '{ print $3 }'` if [ -z "$fastboot" -a "$ROOTFSTYPE" != "nfs" ]; then - STRING="Checking root filesystem" + STRING=`gprintf "Checking root filesystem"` echo $STRING initlog -c "fsck -T -a $fsckoptions /" rc=$? @@ -219,17 +218,17 @@ if [ -z "$fastboot" -a "$ROOTFSTYPE" != "nfs" ]; then failure "$STRING" echo echo - echo "*** An error occurred during the file system check." - echo "*** Dropping you to a shell; the system will reboot" - echo "*** when you leave the shell." + gprintf "*** An error occurred during the file system check.\n" + gprintf "*** Dropping you to a shell; the system will reboot\n" + gprintf "*** when you leave the shell.\n" - PS1="(Repair filesystem) \# # "; export PS1 + PS1=`gprintf "(Repair filesystem) # "`; export PS1 sulogin - echo "Unmounting file systems" + gprintf "Unmounting file systems\n" umount -a mount -n -o remount,ro / - echo "Automatic reboot in progress." + gprintf "Automatic reboot in progress.\n" reboot -f elif [ "$rc" = "1" ]; then _RUN_QUOTACHECK=1 @@ -389,7 +388,7 @@ fi # Add raid devices if [ -f /proc/mdstat -a -f /etc/raidtab ]; then - echo -n "Starting up RAID devices: " + gprintf "Starting up RAID devices: " rc=0 @@ -429,17 +428,17 @@ if [ -f /proc/mdstat -a -f /etc/raidtab ]; then if [ $rc -gt 0 ]; then echo echo - echo "*** An error occurred during the RAID startup" - echo "*** Dropping you to a shell; the system will reboot" - echo "*** when you leave the shell." + gprintf "*** An error occurred during the RAID startup\n" + gprintf "*** Dropping you to a shell; the system will reboot\n" + gprintf "*** when you leave the shell.\n" - PS1="(RAID Repair) \# # "; export PS1 + PS1=`gprintf "(RAID Repair) # "`; export PS1 sulogin - echo "Unmounting file systems" + gprintf "Unmounting file systems\n" umount -a mount -n -o remount,ro / - echo "Automatic reboot in progress." + gprintf "Automatic reboot in progress.\n" reboot -f fi fi @@ -447,8 +446,8 @@ fi _RUN_QUOTACHECK=0 # Check filesystems if [ -z "$fastboot" ]; then - STRING="Checking filesystems" - echo $STRING + STRING=`gprintf "Checking filesystems"` + printf "$STRING\n" initlog -c "fsck -T -R -A -a $fsckoptions" rc=$? if [ "$rc" = "0" ]; then @@ -464,17 +463,17 @@ if [ -z "$fastboot" ]; then failure "$STRING" echo echo - echo "*** An error occurred during the file system check." - echo "*** Dropping you to a shell; the system will reboot" - echo "*** when you leave the shell." + gprintf "*** An error occurred during the file system check.\n" + gprintf "*** Dropping you to a shell; the system will reboot\n" + gprintf "*** when you leave the shell.\n" - PS1="(Repair filesystem) \# # "; export PS1 + PS1=`gprintf "(Repair filesystem) # "`; export PS1 sulogin - echo "Unmounting file systems" + gprintf "Unmounting file systems" umount -a mount -n -o remount,ro / - echo "Automatic reboot in progress." + gprintf "Automatic reboot in progress.\n" reboot -f elif [ "$rc" = "1" -a -x /sbin/quotacheck ]; then _RUN_QUOTACHECK=1 |