]> git.pld-linux.org Git - projects/rc-scripts.git/commitdiff
Fedora compat: fix echo_success and echo_failure formatting
authorElan Ruusamäe <glen@pld-linux.org>
Tue, 9 Apr 2013 22:07:23 +0000 (22:07 +0000)
committerElan Ruusamäe <glen@pld-linux.org>
Tue, 9 Apr 2013 22:07:23 +0000 (22:07 +0000)
svn-id: @12650

lib/functions

index 6359e6a17bcb8738e08cc316f2677b60ed790551..f4395fb92dc2fb3b633f6fbfdc20812fcf2f97c6 100644 (file)
@@ -63,9 +63,14 @@ env_upstart=$USE_UPSTART
 [ -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
 
 [ "$env_upstart" ] && USE_UPSTART=$env_upstart
@@ -430,7 +435,7 @@ busy() {
 }
 
 ok() {
-       echo "$_ok"
+       echo -ne "$_ok${RC_FEDORA+\r}${RC_FEDORA-\n}"
 }
 
 started() {
@@ -438,7 +443,7 @@ started() {
 }
 
 fail() {
-       echo "$_fail"
+       echo -ne "$_fail${RC_FEDORA+\r}${RC_FEDORA-\n}"
        return 1
 }
 
This page took 0.175155 seconds and 4 git commands to generate.