SOURCES: mrtg.init - fix lang without external commands (which wer...

glen glen at pld-linux.org
Fri Oct 21 13:58:05 CEST 2005


Author: glen                         Date: Fri Oct 21 11:58:05 2005 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- fix lang without external commands (which were broken anyway)

---- Files affected:
SOURCES:
   mrtg.init (1.11 -> 1.12) 

---- Diffs:

================================================================
Index: SOURCES/mrtg.init
diff -u SOURCES/mrtg.init:1.11 SOURCES/mrtg.init:1.12
--- SOURCES/mrtg.init:1.11	Fri Oct 21 13:26:02 2005
+++ SOURCES/mrtg.init	Fri Oct 21 13:57:58 2005
@@ -19,15 +19,12 @@
 # Get service config
 [ -f /etc/sysconfig/mrtg ] && . /etc/sysconfig/mrtg
 
-if (echo "$LANG" | grep -qi "UTF-8"); then
-    LANG=$(echo "$LANG" | sed -i -e 's#\.UTF-8#g')
-    export LANG
+if [[ "$LANG" == *[Uu][Tt][Ff]-8 ]]; then
+	export LANG=${LANG%.[Uu][Tt][Ff]-8}
 fi
-if (echo "$LC_ALL" | grep -qi "UTF-8"); then
-    LC_ALL=$(echo "$LC_ALL" | sed -i -e 's#\.UTF-8#g')
-    export LC_ALL
+if [[ "$LC_ALL" == *[Uu][Tt][Ff]-8 ]]; then
+	export LC_ALL=${LC_ALL%.[Uu][Tt][Ff]-8}
 fi
-    
 
 # See how we were called.
 case "$1" in
@@ -35,9 +32,9 @@
 	# Check if the service is already running?
 	if [ ! -f /var/lock/subsys/mrtg ]; then
 		for i in $CONFIGS; do
-		    msg_starting "mrtg ($i)"
-		    daemon mrtg $CONFIGDIR/$i --daemon \
-		    	--logging /var/log/mrtg/$i.log \
+			msg_starting "mrtg ($i)"
+			daemon mrtg $CONFIGDIR/$i --daemon \
+			--logging /var/log/mrtg/$i.log \
 			--pid-file=/var/run/mrtg/$i.pid
 		done
 		RETVAL=$?
@@ -51,7 +48,7 @@
 	if [ -f /var/lock/subsys/mrtg ]; then
 		msg_stopping mrtg
 		killproc mrtg
-		rm -f /var/lock/subsys/mrtg /var/run/mrtg.pid >/dev/null 2>&1	
+		rm -f /var/lock/subsys/mrtg /var/run/mrtg.pid >/dev/null 2>&1
 	else
 		msg_not_running mrtg
 	fi
@@ -83,4 +80,4 @@
 exit $RETVAL
 
 # This must be last line !
-# vi:syntax=sh:tw=78:ts=8:sw=4
+# vi:syntax=sh:tw=78
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/SOURCES/mrtg.init?r1=1.11&r2=1.12&f=u




More information about the pld-cvs-commit mailing list