]> git.pld-linux.org Git - projects/rc-scripts.git/commitdiff
ksh93 support/fixes by Jan Rękorajski <baggins@pld.org.pl> (from stable series)
authorArkadiusz Miśkiewicz <arekm@maven.pl>
Sun, 13 May 2001 17:47:46 +0000 (17:47 +0000)
committerArkadiusz Miśkiewicz <arekm@maven.pl>
Sun, 13 May 2001 17:47:46 +0000 (17:47 +0000)
svn-id: @884

rc.d/init.d/functions
rc.d/init.d/timezone
rc.d/rc
rc.d/rc.shutdown
rc.d/rc.sysinit
sysconfig/network-scripts/ifup
sysconfig/network-scripts/ifup-ppp

index 9ede1655d32bf19364d0e0259c7981394f10f9e0..23bba4914960819839bea64949a08649105270d5 100644 (file)
@@ -1,7 +1,7 @@
 # functions    This file contains functions to be used by most or all
 #              shell scripts in the /etc/init.d directory.
 #
-# $Id: functions,v 1.54.2.3 2000/12/10 23:38:28 misiek Exp $
+# $Id: functions,v 1.54.2.4 2001/05/13 17:47:45 misiek Exp $
 #
 # Author:      Miquel van Smoorenburg, <miquels@drinkel.nl.mugnet.org>
 # Hacked by:    Greg Galloway and Marc Ewing
@@ -51,7 +51,7 @@ termput()
 # printf equivalent
 printf_()
 {
-       local text m
+       typeset text m
        text="$1" ;
        shift ;
        if [ $# -gt 0 ]; then
@@ -68,7 +68,7 @@ printf_()
 # National language support function
 nls()
 {
-       local msg_echo old_nls_domain text message
+       typeset msg_echo old_nls_domain text message
        msg_echo='\n'
        old_nls_domain="$NLS_DOMAIN"
        # parse command line
@@ -143,7 +143,7 @@ msg_usage()
 
 # Some functions to handle PLD-style messages
 show() 
-{      local text
+{      typeset text
        text=$(nls "$@")
        echo -n "$text"
        awk "BEGIN { for (j=length(\"$text\"); j<$INIT_COL; j++) printf \".\" }"
@@ -155,7 +155,7 @@ show()
 # used).
 progress()
 {
-       local COLOR
+       typeset COLOR
        if [ -n "$2" ]; then COLOR="$2"; else COLOR="2"; fi
        deltext
        echo -n "$(termput setaf 6)[$(termput setaf "$COLOR") $(nls --nls-domain rc-scripts "$1") $(termput setaf 6)]$(termput op)"
@@ -200,7 +200,7 @@ deltext()
 # Usage run_cmd Message command_to_run
 run_cmd()
 {
-       local exit_code errors message force_err
+       typeset exit_code errors message force_err
        typeset -i force_err=0
        typeset -i exit_code=0
        case "$1" in
@@ -227,7 +227,7 @@ run_cmd()
 # A function to start a program (now it's usefull on read-only filesystem too)
 daemon() 
 {
-       local nicelevel exit_code errors prog
+       typeset nicelevel exit_code errors prog
        typeset -i nicelevel=0
        typeset -i exit_code=0
        [ -z "$DEFAULT_SERVICE_RUN_NICE_LEVEL" ] && DEFAULT_SERVICE_RUN_NICE_LEVEL=0
@@ -275,7 +275,7 @@ daemon()
 # A function to stop a program.
 killproc() 
 {
-       local notset killlevel base pid
+       typeset notset killlevel base pid
        # Test syntax.
        if [ $# = 0 ]; then
                msg_usage " killproc {program} [signal]"
@@ -355,7 +355,7 @@ killproc()
 # A function to find the pid of a program.
 pidofproc() 
 {
-       local pid
+       typeset pid
        # Test syntax.
        if [ $# = 0 ] ; then
                msg_usage " pidofproc {program}"
@@ -413,7 +413,7 @@ status()
 
 # Confirm whether we really want to run this service
 confirm() {
-       local answer
+       typeset answer
        nls -n "Start service %s (Y)es/(N)o/(C)ontinue? [Y] " "$1"
        read answer
        case $answer in
@@ -489,7 +489,7 @@ is_module()
 
 _modprobe()
 {
-       local parsed single die args foo result
+       typeset parsed single die args foo result
        parsed=no
        while is_no "$parsed" ; do
                case "$1" in
index e47d35948c0d48caf3a434be0dcc98399a9dc14e..2baf95a1d309e5c602fc4650f57255903e3a6633 100644 (file)
@@ -5,7 +5,7 @@
 # description: This script is setting time zone information for your machine.
 # Author:      Pawel Wilk <siefca@pld.org.pl>
 #
-# $Id: timezone,v 1.5.2.2 2001/03/05 14:35:06 misiek Exp $
+# $Id: timezone,v 1.5.2.3 2001/05/13 17:47:46 misiek Exp $
 
 # NLS
 NLS_DOMAIN="rc-scripts"
@@ -36,9 +36,9 @@ case "$1" in
         rm -f /etc/localtime
        if [ -f "$ZONE_FILE" ]; then
                if [ -n "$ZONE_INFO_AREA" ]; then
-                   MESSAGE="`nls "Setting time zone information (%s, %s)" "$ZONE_INFO_AREA" "$TIME_ZONE"`"
+                   MESSAGE="`nls 'Setting time zone information (%s, %s)' "$ZONE_INFO_AREA" "$TIME_ZONE"`"
                else
-                   MESSAGE="`nls "Setting time zone information (%s)" "$TIME_ZONE"`"
+                   MESSAGE="`nls 'Setting time zone information (%s)' "$TIME_ZONE"`"
                fi
                run_cmd "$MESSAGE" ln -s $ZONE_FILE /etc/localtime
                RETVAL=$?
diff --git a/rc.d/rc b/rc.d/rc
index 9859fbec40fdec923a55624f156fb3b9b82c6fcd..0ed821b132ca16586440eb721edf584ea5a2e5bf 100755 (executable)
--- a/rc.d/rc
+++ b/rc.d/rc
@@ -5,7 +5,7 @@
 #               responsible for the very first setup of basic
 #               things, such as setting the hostname.
 #
-# $Id: rc,v 1.25.2.1 2000/10/18 20:10:48 misiek Exp $
+# $Id: rc,v 1.25.2.2 2001/05/13 17:47:45 misiek Exp $
 #
 # Original Author:       
 #               Miquel van Smoorenburg, <miquels@drinkel.nl.mugnet.org>
@@ -109,9 +109,9 @@ stty onlcr -ixon 0>&1
 af2=$(termput setaf 2)
 af6=$(termput setaf 6)
 af7=$(termput setaf 7)
-text="$(termput op)$(nls "%sResource Manager: %sEntering runlevel number" "$af2" "$af7")"
-text_size="$(nls "%sResource Manager: %sEntering runlevel number" "" "")"
-resp_size="$(nls "DONE")"
+text="$(termput op)$(nls '%sResource Manager: %sEntering runlevel number' "$af2" "$af7")"
+text_size="$(nls '%sResource Manager: %sEntering runlevel number' "" "")"
+resp_size="$(nls 'DONE')"
 echo -n "$text"
 awk "BEGIN { for (j=length(\"$text_size\"); j<$INIT_COL+${#resp_size}-${#runlevel}; j++) printf \".\" }"
 echo "${af6}[${af2} $runlevel ${af6}]${af7}"
@@ -195,8 +195,8 @@ else
 fi
 
 # Say something ;)
-text="$(nls "%sResource Manager: %sRunlevel has been reached" "$af2" "$af7")"
-text_size="$(nls "%sResource Manager: %sRunlevel has been reached" "" "")"
+text="$(nls '%sResource Manager: %sRunlevel has been reached' "$af2" "$af7")"
+text_size="$(nls '%sResource Manager: %sRunlevel has been reached' "" "")"
 echo -n "$text"
 awk "BEGIN { for (j=length(\"$text_size\"); j<$INIT_COL+${#resp_size}-${#runlevel}; j++) printf \".\" }"
 echo "${af6}[${af2} $runlevel ${af6}]${af7}"
index 74883e13e247b34680f0a25be350a01b25f9c88a..910854acd2d57886fef65d1ba25f675c1a6c23f8 100755 (executable)
@@ -6,7 +6,7 @@
 # Changes:     Grzegorz Stanislawski <stangrze@open.net.pl>
 #              Arkadiusz Mi¶kiewicz <misiek@pld.org.pl>
 #
-# $Id: rc.shutdown,v 1.12.2.2 2001/05/10 19:23:24 misiek Exp $
+# $Id: rc.shutdown,v 1.12.2.3 2001/05/13 17:47:45 misiek Exp $
 
 # Set the path.
 PATH=/sbin:/bin:/usr/bin:/usr/sbin
@@ -72,7 +72,7 @@ if [ -x /sbin/raidstop -a -f /etc/raidtab ]; then
        if [ -f /proc/mdstat ] ; then
                mddevs=$(awk '/^md.* active/ {print $1}' /proc/mdstat)
                for mddev in $mddevs ; do
-                       MESSAGE="$(nls "Turning off RAID for %s" "$mddev")"
+                       MESSAGE="$(nls 'Turning off RAID for %s' "$mddev")"
                        run_cmd "$MESSAGE" raidstop /dev/$mddev
                done
                unset mddev mddevs
index a3ecf2908fa06405229f8112c377f7035e46ceeb..bf43164685b96cc8dbc3745da094a0efabd5f224 100755 (executable)
@@ -1,7 +1,7 @@
 #!/bin/sh
 #
 # /etc/rc.d/rc.sysinit - run once at boot time
-# $Id: rc.sysinit,v 1.69.2.7 2001/05/13 14:47:15 misiek Exp $
+# $Id: rc.sysinit,v 1.69.2.8 2001/05/13 17:47:45 misiek Exp $
 #
 # Taken in part from Miquel van Smoorenburg's bcheckrc.
 # Changes:      Arkadiusz Mi¶kiewicz <misiek@pld.org.pl>
@@ -142,8 +142,8 @@ esac
 
 # Check if timezone definition is available
 if [ -e /etc/localtime ] ; then
-       if run_cmd "$(nls "Setting clock")$CLOCKDEF" /sbin/hwclock $CLOCKFLAGS; then
-               show "$(nls "Today's date:") $(LC_CTYPE=C date)"; ok
+       if run_cmd "$(nls 'Setting clock')$CLOCKDEF" /sbin/hwclock $CLOCKFLAGS; then
+               show "$(nls 'Today`s date:') $(LC_CTYPE=C date)"; ok
        fi
 else
        TIME_SETUP_DELAYED=yes
@@ -153,11 +153,11 @@ fi
 run_cmd "Activating swap partitions" swapon -a
 
 # Set the hostname.
-run_cmd "$(nls "Host:") ${HOSTNAME}" hostname ${HOSTNAME}
+run_cmd "$(nls 'Host:') ${HOSTNAME}" hostname ${HOSTNAME}
 
 # Set the NIS domain name
 if [ -n "$NISDOMAIN" ]; then
-       run_cmd "$(nls "NIS Domain:") ${NISDOMAIN}" domainname $NISDOMAIN
+       run_cmd "$(nls 'NIS Domain:') ${NISDOMAIN}" domainname $NISDOMAIN
 else
        domainname ""
 fi
@@ -195,13 +195,14 @@ if awk '{ if ($2 ~ /^\/$/ && ( $3 ~ /^(nfs|romfs)$/ || $6 ~ /^0$/ ) ) exit 1 ; e
            # A return of 2 or higher means there were serious problems.
            if [ $rc -gt 1 ]; then
                    # don't use '\n' in nls macro !
-                   echo "\n\n"
+                   echo
+                   echo
                    nls "*** An error occurred during the file system check."
                    nls "*** Dropping you to a shell; the system will reboot"
                    nls "*** when you leave the shell."
                    echo
 
-                   PS1="$(nls "(Repair filesystem)# ")"; export PS1
+                   PS1="$(nls '(Repair filesystem)# ')"; export PS1
                    if is_yes "$RUN_SULOGIN_ON_ERR"; then
                            sulogin
                    else
@@ -386,13 +387,14 @@ if [ -f /proc/mdstat -a -f /etc/raidtab ]; then
        # A non-zero return means there were problems.
        if [ $rc -gt 0 ]; then
                show "Starting up RAID devices."; fail
-               echo "\n\n"
+               echo
+               echo
                nls "*** An error occurred during the RAID startup"
                nls "*** Dropping you to a shell; the system will reboot"
                nls "*** when you leave the shell."
                echo
 
-               PS1="$(nls "(RAID Repair)# ")"; export PS1
+               PS1="$(nls '(RAID Repair)# ')"; export PS1
                if is_yes "$RUN_SULOGIN_ON_ERR"; then
                        sulogin
                else
@@ -421,13 +423,14 @@ if ! grep -q nofsck /proc/cmdline && [ ! -f /fastboot ]; then
 
        # A return of 2 or higher means there were serious problems.
        if [ $rc -gt 1 ]; then
-               echo "\n\n"
+               echo
+               echo
                nls "*** An error occurred during the file system check."
                nls "*** Dropping you to a shell; the system will reboot"
                nls "*** when you leave the shell."
                echo
 
-               PS1="$(nls "(Repair filesystem)# ")"; export PS1
+               PS1="$(nls '(Repair filesystem)# ')"; export PS1
                if is_yes "$RUN_SULOGIN_ON_ERR"; then
                        sulogin
                else
@@ -438,6 +441,14 @@ if ! grep -q nofsck /proc/cmdline && [ ! -f /fastboot ]; then
                run_cmd "Remounting root filesystem in ro mode" mount -n -o remount,ro /
                run_cmd "Automatic reboot in progress." reboot
        elif [ "$rc" = "1" -a -x /sbin/quotacheck ]; then
+               if [ -x /sbin/convertquota ]; then
+                       if [ -f /quota.user ]; then
+                           /sbin/convertquota -u / && rm -f /quota.user
+                       fi
+                       if [ -f /quota.group ]; then
+                           /sbin/convertquota -g / && rm -f /quota.group
+                       fi
+               fi
                run_cmd "Checking filesystem quotas" /sbin/quotacheck -v -u -g -R -a
        fi
 fi
@@ -449,8 +460,8 @@ run_cmd "Mounting local filesystems." mount -a -t nonfs,smbfs,ncpfs,proc
 
 # Set the clock if timezone definition wasn't available (eg. /usr not mounted)
 if is_yes "$TIME_SETUP_DELAYED"; then
-       if run_cmd "$(nls "Setting clock")$CLOCKDEF" /sbin/hwclock $CLOCKFLAGS; then
-               show "$(nls "Today's date:") $(LC_CTYPE=C date)"; ok
+       if run_cmd "$(nls 'Setting clock')$CLOCKDEF" /sbin/hwclock $CLOCKFLAGS; then
+               show "$(nls 'Today`s date:') $(LC_CTYPE=C date)"; ok
        fi
 fi
 
@@ -464,7 +475,7 @@ if [ -f /etc/rc.d/rc.serial ]; then
 fi
 
 if [ -f /proc/sys/kernel/panic -a "$PANIC_REBOOT_TIME" -gt "0" ]; then
-       show "Setting %s seconds for kernel reboot after panic." "$PANIC_REBOOT_TIME"; busy
+       show 'Setting %s seconds for kernel reboot after panic.' "$PANIC_REBOOT_TIME"; busy
        if (sysctl -w kernel.panic=$PANIC_REBOOT_TIME 2> /dev/null); then ok; else fail; fi
 fi
 
index 025421faec9008d9b34eef8ca954395170dc2ee7..65661adbd599a5199a46ccfaa972c50bfb8775b9 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-#      $Id: ifup,v 1.42.2.7 2001/03/19 15:48:18 misiek Exp $
+#      $Id: ifup,v 1.42.2.8 2001/05/13 17:47:46 misiek Exp $
 #
 PATH=/sbin:/usr/sbin:/bin:/usr/bin
 
@@ -128,7 +128,7 @@ if [ -n "$BOOTMETHOD" -a "$BOOTMETHOD" != "none" ]; then
        fi
        DHCP_ARGS="$DHCP_OPTIONS $DHCP_ARGS"
        
-       if ! run_cmd "$(nls "Determining IP information for") $DEVICE ($(basename $DHCP_CLIENT))" $DHCP_CLIENT $DHCP_ARGS ; then
+       if ! run_cmd "$(nls 'Determining IP information for') $DEVICE ($(basename $DHCP_CLIENT))" $DHCP_CLIENT $DHCP_ARGS ; then
                exit 1
        fi
 
index d84d0fa64ab3099d4b2bf83d8d27f2dda2d4d67d..d539cb2486052b1ba8ab78f2b25267984d1f6ca4 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-#      $Id: ifup-ppp,v 1.13.2.3 2001/04/16 14:50:01 dobrek Exp $
+#      $Id: ifup-ppp,v 1.13.2.4 2001/05/13 17:47:46 misiek Exp $
 #
 # ifup-ppp script for pppd-2.3.5 (with persist & demand options) ver 0.2
 # Grzegorz Stanislawski <stangrze@open.net.pl>
@@ -38,7 +38,7 @@ fi
   nls "/usr/sbin/pppd does not exist or is not executable"
   nls "ifup-ppp for %s exiting" "$DEVICE"
     logger -p daemon.info -t ifup-ppp \
-    "$(nls "/usr/sbin/pppd does not exist or is not executable for %s" "$DEVICE")"
+    "$(nls '/usr/sbin/pppd does not exist or is not executable for %s' "$DEVICE")"
   exit 1
 }
 
This page took 0.283543 seconds and 4 git commands to generate.