SVN: rc-scripts/trunk/lib/functions
glen
glen at pld-linux.org
Wed Apr 10 00:07:24 CEST 2013
Author: glen
Date: Wed Apr 10 00:07:23 2013
New Revision: 12650
Modified:
rc-scripts/trunk/lib/functions
Log:
Fedora compat: fix echo_success and echo_failure formatting
Modified: rc-scripts/trunk/lib/functions
==============================================================================
--- rc-scripts/trunk/lib/functions (original)
+++ rc-scripts/trunk/lib/functions Wed Apr 10 00:07:23 2013
@@ -63,9 +63,14 @@
[ -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 @@
}
ok() {
- echo "$_ok"
+ echo -ne "$_ok${RC_FEDORA+\r}${RC_FEDORA-\n}"
}
started() {
@@ -438,7 +443,7 @@
}
fail() {
- echo "$_fail"
+ echo -ne "$_fail${RC_FEDORA+\r}${RC_FEDORA-\n}"
return 1
}
More information about the pld-cvs-commit
mailing list