POWERSHELL 30
Update.sh Guest on 7th July 2020 01:52:48 PM
  1. #!/bin/sh
  2. ##
  3. ## update.sh, written by Sergey B Kirpichev <[email protected]>
  4. ##
  5. ## Update AWStats data for all configs, awstats.*.conf (Debian specific)
  6. ##
  7.  
  8. set -e
  9.  
  10. DEFAULT=/etc/default/awstats
  11. AWSTATS=/usr/lib/cgi-bin/awstats.pl
  12. ERRFILE=`mktemp --tmpdir awstats.XXXXXXXXXX`
  13.  
  14. trap 'rm -f $ERRFILE' INT QUIT TERM EXIT
  15.  
  16. [ -f $AWSTATS ] || exit 1
  17.  
  18. # Set defaults.
  19. AWSTATS_NICE=10
  20. [ ! -r "$DEFAULT" ] || . "$DEFAULT"
  21.  
  22. cd /etc/awstats
  23.  
  24. for c in `/bin/ls -1 awstats.*.conf 2>/dev/null | \
  25.           /bin/sed 's/^awstats\.\(.*\)\.conf/\1/'` \
  26.          `[ -f /etc/awstats/awstats.conf ] && echo awstats`
  27. do
  28.   if ! nice -n $AWSTATS_NICE $AWSTATS \
  29.           -config=$c \
  30.           -update >$ERRFILE 2>&1
  31.   then
  32.     cat $ERRFILE >&2 # an error occurred
  33.   fi
  34. done

Paste is for source code and general debugging text.

Login or Register to edit, delete and keep track of your pastes and more.

Raw Paste

Login or Register to edit or fork this paste. It's free.