]> TLD Linux GIT Repositories - rc-scripts.git/commitdiff
- merged shell fixes patch
authorMarcin Krol <hawk@tld-linux.org>
Tue, 14 Jul 2015 13:13:43 +0000 (13:13 +0000)
committerMarcin Krol <hawk@tld-linux.org>
Tue, 14 Jul 2015 13:13:43 +0000 (13:13 +0000)
lib/functions
rc.d/rc
rc.d/rc.sysinit

index 98de9cc751aab69f60b2deff4bc31f9620111ffb..04e7f29332e7ee316b75de17381e6c655fb4fea5 100644 (file)
@@ -58,17 +58,6 @@ CCHARS="$NORMAL"     # Color of these characters (look at /etc/sysconfig/init-colors
 [ -r /etc/sysconfig/system ] && . /etc/sysconfig/system
 [ -r /etc/sysconfig/bootsplash ] && . /etc/sysconfig/bootsplash
 
 [ -r /etc/sysconfig/system ] && . /etc/sysconfig/system
 [ -r /etc/sysconfig/bootsplash ] && . /etc/sysconfig/bootsplash
 
-# if initscript is invoked via bash, enable RedHat/Fedora compatibility
-# RC_FEDORA is "set" if enabled and "unset" when not, but it's "value" is always empty
-# this is useful for inline constructs
-if [ "${BASH_VERSION+set}" = "set" ]; then
-       RC_LOGGING=yes
-       FASTRC=no
-       RC_FEDORA=
-else
-       unset RC_FEDORA || :
-fi
-
 if [ -z "$VSERVER" -o "$VSERVER" = "detect" ]; then
        {
                while read _f _ctx; do
 if [ -z "$VSERVER" -o "$VSERVER" = "detect" ]; then
        {
                while read _f _ctx; do
@@ -466,7 +455,7 @@ busy() {
 }
 
 ok() {
 }
 
 ok() {
-       echo -ne "$_ok${RC_FEDORA+\\r}${RC_FEDORA-\\n}"
+       echo "$_ok"
 }
 
 started() {
 }
 
 started() {
@@ -474,7 +463,7 @@ started() {
 }
 
 fail() {
 }
 
 fail() {
-       echo -ne "$_fail${RC_FEDORA+\\r}${RC_FEDORA-\\n}"
+       echo "$_fail"
        return 1
 }
 
        return 1
 }
 
diff --git a/rc.d/rc b/rc.d/rc
index eba065216057ae8b472ed76d3b6dd01f5e2493a5..04d6f383747528a4120f227cc023abef6e92b368 100755 (executable)
--- a/rc.d/rc
+++ b/rc.d/rc
@@ -147,14 +147,15 @@ af7=$(termput op)
 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')"
-{
-       local _len=${#text_size}
-       local _last_col=$(($INIT_COL+${#resp_size}-${#runlevel}))
-       while [ $((_len++)) -lt $_last_col ]; do
-               text="$text."
-       done
-       echo -n "$text"
-}
+
+_len=${#text_size}
+_last_col=$(($INIT_COL+${#resp_size}-${#runlevel}))
+while [ $((_len++)) -lt $_last_col ]; do
+       text="$text."
+done
+echo -n "$text"
+unset _len _last_col
+
 echo "${af6}[${af2} $runlevel ${af6}]${af7}"
 
 # Is there an rc directory for this new runlevel?
 echo "${af6}[${af2} $runlevel ${af6}]${af7}"
 
 # Is there an rc directory for this new runlevel?
index 121e48f91e7fe633369420d2603bd53978db8468..dc3475b0ddff708014bb6b422e20d5000207baec 100755 (executable)
@@ -952,7 +952,7 @@ if ! is_yes "$VSERVER" && [[ "$container" != lxc* ]]; then
                . /etc/rc.d/rc.serial
        fi
 
                . /etc/rc.d/rc.serial
        fi
 
-       if [ -n "$PANIC_REBOOT_TIME" -a "$PANIC_REBOOT_TIME" -gt "0" -a -f /proc/sys/kernel/panic ]; then
+       if [ -n "$PANIC_REBOOT_TIME" ] && [ "$PANIC_REBOOT_TIME" -gt "0" ] && [ -f /proc/sys/kernel/panic ]; then
                show 'Setting %s seconds for kernel reboot after panic' "$PANIC_REBOOT_TIME"; busy
                # DEPRECATED: use /etc/sysctl.conf or kernel commandline instead
                if sysctl -q -w kernel.panic=$PANIC_REBOOT_TIME; then ok; else fail; fi
                show 'Setting %s seconds for kernel reboot after panic' "$PANIC_REBOOT_TIME"; busy
                # DEPRECATED: use /etc/sysctl.conf or kernel commandline instead
                if sysctl -q -w kernel.panic=$PANIC_REBOOT_TIME; then ok; else fail; fi