SVN: rc-scripts/trunk/rc.d/init.d/functions

baggins baggins at pld-linux.org
Thu Apr 26 17:30:45 CEST 2007


Author: baggins
Date: Thu Apr 26 17:30:44 2007
New Revision: 8472

Modified:
   rc-scripts/trunk/rc.d/init.d/functions
Log:
- unify command substitution (`` -> $())


Modified: rc-scripts/trunk/rc.d/init.d/functions
==============================================================================
--- rc-scripts/trunk/rc.d/init.d/functions	(original)
+++ rc-scripts/trunk/rc.d/init.d/functions	Thu Apr 26 17:30:44 2007
@@ -487,15 +487,15 @@
 	fi
 
 	if [ -n "$KSH_VERSION" ]; then
-		limits="`echo "${SERVICE_LIMITS:-$DEFAULT_SERVICE_LIMITS}" | awk '/-Su/ {sub(/-Su/,"-Sp");} /-Hu/ {sub(/-Hu/,"-Hp");} /-u/ {sub(/-u/,"-p");} {print;}'`"
+		limits="$(echo "${SERVICE_LIMITS:-$DEFAULT_SERVICE_LIMITS}" | awk '/-Su/ {sub(/-Su/,"-Sp");} /-Hu/ {sub(/-Hu/,"-Hp");} /-u/ {sub(/-u/,"-p");} {print;}')"
 	elif [ -n "$ZSH_VERSION" ]; then
 		limits="${SERVICE_LIMITS:-$DEFAULT_SERVICE_LIMITS}"
 	elif [ -n "$BASH_VERSION" ]; then
 		limits="${SERVICE_LIMITS:-$DEFAULT_SERVICE_LIMITS}"
-#	elif [ -n "`$SH -c 'echo ${.sh.version}' 2>/dev/null`" ]; then
+#	elif [ -n "$($SH -c 'echo ${.sh.version}' 2>/dev/null)" ]; then
 	fi
 
-	[ -n "$limits" ] && eval `echo "$limits" | awk 'BEGIN {RS="[\n-]";} !/^ *$/ { printf("ulimit -%s ;", $0); }'`
+	[ -n "$limits" ] && eval $(echo "$limits" | awk 'BEGIN {RS="[\n-]";} !/^ *$/ { printf("ulimit -%s ;", $0); }')
 
 	[ -z "$DEFAULT_SERVICE_UMASK" ] && DEFAULT_SERVICE_UMASK=022
 
@@ -708,10 +708,10 @@
 		nls "%s (pid %s) is running%s" "$daemon" "$pid" "$cpuset_msg"
 		return 0
 #	else
-#		pid=`ps ax | awk 'BEGIN { prog=ARGV[1]; ARGC=1 }
+#		pid=$(ps ax | awk 'BEGIN { prog=ARGV[1]; ARGC=1 }
 #		     { if ((prog == $5) || (("(" prog ")") == $5) ||
 #			(("[" prog "]") == $5) ||
-#			((prog ":") == $5)) { print $1 ; exit 0 } }' $1`
+#			((prog ":") == $5)) { print $1 ; exit 0 } }' $1)
 #		if [ "$pid" != "" ]; then
 #			cpuset_msg="..."
 #			if is_yes "$CPUSETS" && [ -n "$SERVICE_CPUSET" ]; then
@@ -846,7 +846,7 @@
 failure () { return 1; }
 
 disable_selinux() {
-	selinuxfs=`awk '/ selinuxfs / { print $2 }' /proc/mounts`
+	selinuxfs=$(awk '/ selinuxfs / { print $2 }' /proc/mounts)
 	echo "*** Warning -- SELinux is active"
 	echo "*** Disabling security enforcement for system recovery."
 	echo "*** Run 'setenforce 1' to reenable."
@@ -854,7 +854,7 @@
 }
 
 relabel_selinux() {
-	selinuxfs=`awk '/ selinuxfs / { print $2 }' /proc/mounts`
+	selinuxfs=$(awk '/ selinuxfs / { print $2 }' /proc/mounts)
 	echo "
          *** Warning -- SELinux relabel is required. ***
          *** Disabling security enforcement.         ***
@@ -890,8 +890,8 @@
 			return 1
 		fi
 	elif [ -x /sbin/pidof ]; then
-		[ -z "`/sbin/pidof portmap`" -a \
-		  -z "`/sbin/pidof rpcbind`" ] && return 1
+		[ -z "$(/sbin/pidof portmap)" -a \
+		  -z "$(/sbin/pidof rpcbind)" ] && return 1
 	fi
 	return 0
 }


More information about the pld-cvs-commit mailing list