]> git.pld-linux.org Git - packages/awffull.git/blobdiff - awffull.cron
- FORCE_USER option
[packages/awffull.git] / awffull.cron
index e5d272fac2e1f8502f31cf563718ee9a1bb3c087..1dc4e49dde330bea671314665a078cc9f9c09d26 100644 (file)
@@ -5,15 +5,22 @@ CONFIG_LIST=""
 [ -f /etc/sysconfig/awffull ] && . /etc/sysconfig/awffull
 umask 0022
 
+if [ -n "$FORCE_USER" ]; then
+       if [ "$FORCE_USER" != "`id -un`" ]; then
+               echo "Wrong current user. $FORCE_USER is required!"
+               exit 1
+       fi
+fi
+
 if [ -n "$ENABLE" ] && [ "$ENABLE" = "yes" -o "$ENABLE" = "YES" ]; then
        LC_ALL=$LANG
        export LANG
        export LC_ALL
        
-       if [ -n "$REALLY_QUIET" ] && [ "$REALLY_QUIET" = "yes" -o "$REALLY_QUIET" = "YES" ]; then
-               AWFFULL_OPTS="-Q"
-       elif [ -n "$QUIET" ] && [ "$QUIET" = "yes" -o "$QUIET" = "YES" ]; then
+       if [ -n "$QUIET" ] && [ "$QUIET" = "yes" -o "$QUIET" = "YES" ]; then
                AWFFULL_OPTS="-q"
+       elif [ -n "$REALLY_QUIET" ] && [ "$REALLY_QUIET" = "yes" -o "$REALLY_QUIET" = "YES" ]; then
+               AWFFULL_OPTS="-Q"
        fi
        
        if [ -n "$MULTIPLE" ] && [ "$MULTIPLE" = "yes" -o "$MULTIPLE" = "YES" ]; then
@@ -29,10 +36,11 @@ if [ -n "$ENABLE" ] && [ "$ENABLE" = "yes" -o "$ENABLE" = "YES" ]; then
                        TMPCONFIG=`mktemp -q /var/lib/dnshistory/awffull_config.XXXXXX`
                        LOGFILE=`grep ^LogFile ${singleconfig} | awk '{ print $2;}'`
                        grep -v ^LogFile ${singleconfig} > ${TMPCONFIG}
-                       dnshistory -T -f ${LOGFILE} | awffull ${AWFFULL_OPTS} -c ${TMPCONFIG} - ;
+                       nice -n 19 dnshistory -f ${LOGFILE}
+                       nice -n 19 dnshistory -T -f ${LOGFILE} | awffull ${AWFFULL_OPTS} -c ${TMPCONFIG} - ;
                        rm -f ${TMPCONFIG}
                else
-                       awffull ${AWFFULL_OPTS} -c ${singleconfig};
+                       nice -n 19 awffull ${AWFFULL_OPTS} -c ${singleconfig};
                fi
        done
 fi
This page took 0.048559 seconds and 4 git commands to generate.