SOURCES: sarg-user_limit_block - secured

glen glen at pld-linux.org
Wed Feb 7 18:20:49 CET 2007


Author: glen                         Date: Wed Feb  7 17:20:49 2007 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- secured

---- Files affected:
SOURCES:
   sarg-user_limit_block (1.1 -> 1.2) 

---- Diffs:

================================================================
Index: SOURCES/sarg-user_limit_block
diff -u SOURCES/sarg-user_limit_block:1.1 SOURCES/sarg-user_limit_block:1.2
--- SOURCES/sarg-user_limit_block:1.1	Wed Feb  7 18:20:16 2007
+++ SOURCES/sarg-user_limit_block	Wed Feb  7 18:20:43 2007
@@ -2,17 +2,18 @@
 
 conf="/etc/sarg/sarg.conf"
 squid_password_file="/etc/squid/passwd"
-tmp="/tmp/sarg_limit.$$"
 
 limit_file=`grep "per_user_limit" $conf|grep -v "#"|awk '{print $2}'`
+limit_file=$(awk '/^per_user_limit/{ print $2 }' $conf)
 
-if [ "$limit_file" != "" ]; then
-   rm -rf $tmp
-   cat $limit_file|while read key; do
-      uline=`grep $key $squid_password_file`
-      grep -v $key $squid_password_file > $tmp
-      echo $uline|sed 's/:/:*/g' >> $tmp
-      cat $tmp > $squid_password_file
-      rm -rf $tmp
-   done
+if [ "$limit_file" ]; then
+	tmp=$(mktemp)
+	while read key; do
+		uline=$(grep $key $squid_password_file)
+		grep -v $key $squid_password_file > $tmp
+		echo $uline | sed 's/:/:*/g' >> $tmp
+		cat $tmp > $squid_password_file
+		rm -f
+	done < $limit_file
+	rm -f $tmp
 fi
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/SOURCES/sarg-user_limit_block?r1=1.1&r2=1.2&f=u



More information about the pld-cvs-commit mailing list