summaryrefslogtreecommitdiff
path: root/localwebstats
blob: 02c56bad025b1f9e6820ddb26a80b82ec1df295e (plain)
  1. #!/bin/bash
  2. #
  3. # /usr/local/sbin/localwebstats
  4. # Copyright 2001-2002 Jonas Smedegaard <dr@jones.dk>
  5. #
  6. # $Id: localwebstats,v 1.40 2004-12-29 17:14:23 jonas Exp $
  7. #
  8. # Webstats maintenance script
  9. #
  10. # Example config file (/etc/local/webstats.conf).
  11. #
  12. # --- CUT --- CUT --- CUT ---
  13. # #!/bin/sh
  14. #
  15. # # * Websites are in /home/<uid>/websites/<fqdn>
  16. # # * Apache httpd.conf has this line added:
  17. # # Include /etc/apache/vhosts.d
  18. # # * Apache use /usr/local/bin/parselog into /var/log/apache-vhosts/
  19. # # * /usr/lib/apache/suexec is recompiled using /usr/local/bin/make-suexec-for-home
  20. # # * Each webhost has apache config in /etc/apache/vhosts.d/<fqdn>
  21. # # * /etc/apache/vhosts.d/<fqdn> has hints about host- and domain-part of fqdn:
  22. # # # webstats: hostname: <hostname>
  23. # # # webstats: domainname: <domainname>
  24. #
  25. # #WEBALIZER_OPTIONS="-Q"
  26. #
  27. # LOGROOT='/var/log/apache-vhosts'
  28. # WEBROOT='/home'
  29. #
  30. # function statsdir() { echo /home/jonas/websites/stats.$(dnsdomainname)/$3; }
  31. # function webdirs() { find /etc/apache/vhosts.d/ -type f -exec egrep '^#\W*webstats:' '{}' -l ';' | xargs basename; }
  32. # function host() { cat /etc/apache/vhosts.d/$3 | egrep '#\W*webstats:\W*hostname:\W*[\.[:alnum:]]+\W*$' | sed 's/^.*:\W\([\.[:alnum:]]\+\)\W*$/\1/'; }
  33. # function domain() { cat /etc/apache/vhosts.d/$3 | egrep '#\W*webstats:\W*domainname:\W*[\.[:alnum:]]+\W*$' | sed 's/^.*:\W\([\.[:alnum:]]\+\)\W*$/\1/'; }
  34. #
  35. # --- CUT --- CUT --- CUT ---
  36. #
  37. # TODO: Run as non-provoleged user
  38. #
  39. # halt on errors
  40. set -e
  41. function usage() {
  42. echo "Usage: $(basename $0) init|update|prelogrotate|postlogrotate|ignore <website> [<website>...]"
  43. echo " If no website is given, all are attempted"
  44. echo " Tip: Automagically runs when symlinked to /etc/cron.{daily,weekly,monthly}/"
  45. exit 1
  46. }
  47. function exit1() {
  48. echo "Error: $1"
  49. echo "Exiting..."
  50. exit 1
  51. }
  52. # automagically configure when run from cron dirs
  53. case $(dirname $0) in
  54. /etc/cron.daily)
  55. stamp=update
  56. ;;
  57. /etc/cron.weekly)
  58. stamp=ignore
  59. ;;
  60. /etc/cron.monthly)
  61. stamp=ignore
  62. ;;
  63. *)
  64. stamp=$1
  65. shift || usage
  66. ;;
  67. esac
  68. case "$stamp" in
  69. init|update|prelogrotate|postlogrotate|ignore)
  70. ;;
  71. *)
  72. usage
  73. ;;
  74. esac
  75. if [ "$stamp" = "ignore" ]; then
  76. [ $DEBUG ] && echo "Asked to ignore - exiting silently..."
  77. exit 0
  78. fi
  79. ROOT=1
  80. user=www-data
  81. group=www-data
  82. LOGROOT=/var/log/apache-vhosts
  83. WEBROOT=/var/www
  84. # Options: $1=LOGROOT, $2=WEBROOT, $3=WEBSITE
  85. function statsdir() { echo $2/VIRTUAL/stats.$(dnsdomainname)/www/$3; }
  86. function webdirs() { find $1 -type d -mindepth 1 -maxdepth 1 | grep '\.*\.' | sed 's!$1!!'; }
  87. #function logfiles() { $(ls -r $LOGDIR/*-access*.gz) $(ls -r $LOGDIR/access*.??.gz) $(ls -r $LOGDIR/access*.?.gz) $(ls -r $LOGDIR/access*.?); }
  88. function logcontentresolved() { for file in $(find $1/$3 -name '????.??.00.gz' -type f -mindepth 1 -maxdepth 1 -follow | sort); do zcat $file; done; for file in $(find $1/$3 -name '????.??.00' -type f -mindepth 1 -maxdepth 1 -follow | sort); do cat $file; done; }
  89. function logcontent() { for file in $(find $1/$3 -name '????.??.??.gz' ! -name '*00.gz' -type f -mindepth 1 -maxdepth 1 -follow | sort); do zcat $file; done; for file in $(find $1/$3 -name '????.??.??' ! -name '*00' -type f -mindepth 1 -maxdepth 1 -follow | sort); do cat $file; done; }
  90. function host() { cat $2/VIRTUAL/$3/hostname || exit1 "Unable to get hostname for virtual host."; }
  91. function domain() { cat $2/VIRTUAL/$3/domainname || exit1 "Unable to get domainname for virtual host."; }
  92. function analog_cfg() { echo /etc/analog_$3.conf; }
  93. function rmagic_cfg() { echo /etc/rmagic/rmagic_$3.conf; }
  94. function webalizer_cfg() { echo /etc/webalizer_$3.conf; }
  95. function modlogan_cfg() { echo /etc/modlogan/modlogan_$3.conf; }
  96. function pre_init() { true; }
  97. function post_init() { statsdir="`statsdir $1 $2 $3`"; test -f $statsdir/../COMMON/index.html && cp $statsdir/../COMMON/index.html $statsdir/ || /bin/true; }
  98. function pre_update() { true; }
  99. function post_update() { true; }
  100. # The above can be overridden
  101. LOCALCONFIG=/etc/local/webstats.conf
  102. . $LOCALCONFIG || echo "WARNING: Unable to read config file $LOCALCONFIG"
  103. # variables and functions too boring to be configurable
  104. JDRESOLVE_BIN="/usr/bin/jdresolve"
  105. JDRESOLVE_OPTIONS="-r -t 5"
  106. JDRESOLVE_DB="/var/cache/jdresolve/hosts.db"
  107. JDRESOLVE_EXPIRY="48"
  108. LOGRESOLVE_BIN="/usr/sbin/logresolve"
  109. ANALOG_BIN="/usr/bin/analog"
  110. RMAGIC_BIN="/usr/bin/rmagic"
  111. WEBALIZER_BIN="/usr/bin/webalizer"
  112. MODLOGAN_BIN="/usr/bin/modlogan"
  113. AWSTATS_BIN="/usr/lib/cgi-bin/awstats.pl"
  114. function awstats_setlog() { sed -e "s!^\(LogFile=\).*\$!\\1$2!" $1 > $1.tmp; mv $1.tmp $1; }
  115. # Website/independent checks
  116. test -d $WEBROOT || exit1 "Webroot \"$WEBROOT\" doesn't exist"
  117. test -d $LOGROOT || exit1 "Logroot \"$LOGROOT\" doesn't exist"
  118. if [ -x $JDRESOLVE_BIN -a -n "$JDRESOLVE_DB" ]; then
  119. JDRESOLVE_OPTIONS="$JDRESOLVE_OPTIONS --database=$JDRESOLVE_DB --dbfirst"
  120. test -d $(dirname "$JDRESOLVE_DB") || exit1 "Cache dir for jdresolve doesn't exist"
  121. if [ -n "$JDRESOLVE_EXPIRY" ]; then
  122. if [ $DEBUG ]; then
  123. jdresolve $JDRESOLVE_OPTIONS --expiredb="$JDRESOLVE_EXPIRY"
  124. else
  125. jdresolve $JDRESOLVE_OPTIONS --expiredb="$JDRESOLVE_EXPIRY" > /dev/null 2>&1
  126. fi
  127. fi
  128. fi
  129. # Generate stats for websites from stdin or all default sites
  130. WEBSITES=$@
  131. if [ "$WEBSITES" = "" ]; then
  132. WEBSITES=$(webdirs $LOGROOT $WEBROOT $WEBSITE)
  133. fi
  134. for WEBSITE in $WEBSITES; do
  135. STATSDIR=$(statsdir $LOGROOT $WEBROOT $WEBSITE) || exit1 "Unable to resolve STATSDIR."
  136. # FIXME test -d $STATSDIR/.. || exit1 "Directory above STATSDIR doesn't exist."
  137. ANALOG_CFG=$(analog_cfg $LOGROOT $WEBROOT $WEBSITE) || exit1 "Unable to resolve ANALOG_CFG."
  138. RMAGIC_CFG=$(rmagic_cfg $LOGROOT $WEBROOT $WEBSITE) || exit1 "Unable to resolve RMAGIC_CFG."
  139. WEBALIZER_CFG=$(webalizer_cfg $LOGROOT $WEBROOT $WEBSITE) || exit1 "Unable to resolve WEBALIZER_CFG."
  140. MODLOGAN_CFG=$(modlogan_cfg $LOGROOT $WEBROOT $WEBSITE) || exit1 "Unable to resolve MODLOGAN_CFG."
  141. if [ $stamp = "init" ]; then
  142. [ $DEBUG ] && echo "Execute $WEBSITE PRE_INIT"
  143. pre_init $LOGROOT $WEBROOT $WEBSITE || exit1 "Error executing PRE_INIT."
  144. fi
  145. if [ $stamp = "update" ]; then
  146. [ $DEBUG ] && echo "Execute $WEBSITE PRE_UPDATE"
  147. pre_update $LOGROOT $WEBROOT $WEBSITE || exit1 "Error executing PRE_UPDATE."
  148. fi
  149. HOST=$(host $LOGROOT $WEBROOT $WEBSITE) || exit1 "Unable to get hostname for virtual host."
  150. DOMAIN=$(domain $LOGROOT $WEBROOT $WEBSITE) || exit1 "Unable to get domainname for virtual host."
  151. ANALOG_OPTIONS="-G +g/etc/analog.cfg +g$ANALOG_CFG +A -a"
  152. RMAGIC_OPTIONS=""
  153. WEBALIZER_OPTIONS="-c /etc/webalizer.conf -c $WEBALIZER_CFG -o $STATSDIR/webalizer -f"
  154. MODLOGAN_OPTIONS="-c $MODLOGAN_CFG"
  155. MODLOGAN_TAIL="2>&1 | egrep -v '^(modlogan [\.0-9]+|.+: startup - finished|[[:space:]]*(\[\.*|[[:space:]]+[0-9]+|\.*\])+|.*unknown country code: (gbl|lcl|tld) .+|.+: No such file or directory, first run \?)$' || true if [ $? \< 2 ]"
  156. AWSTATS_OPTIONS="-update"
  157. FQDN_ESC=`echo "$HOST.$DOMAIN" | sed -e 's/\./\\\./g'` # needed for awstats config
  158. if [ $DEBUG ]; then
  159. echo "Making stats for $WEBSITE in $STATSDIR:"
  160. JDRESOLVE_OPTIONS="$JDRESOLVE_OPTIONS -p"
  161. ANALOG_OPTIONS="$ANALOG_OPTIONS +q"
  162. RMAGIC_OPTIONS="$RMAGIC_OPTIONS"
  163. WEBALIZER_OPTIONS="$WEBALIZER_OPTIONS -T"
  164. MODLOGAN_OPTIONS="$MODLOGAN_OPTIONS"
  165. MODLOGAN_TAIL=""
  166. AWSTATS_OPTIONS="$AWSTATS_OPTIONS -showsteps"
  167. else
  168. JDRESOLVE_OPTIONS="$JDRESOLVE_OPTIONS -n"
  169. ANALOG_OPTIONS="$ANALOG_OPTIONS -q"
  170. RMAGIC_OPTIONS="$RMAGIC_OPTIONS -statistics_Verbose=NONE"
  171. WEBALIZER_OPTIONS="$WEBALIZER_OPTIONS -Q"
  172. MODLOGAN_OPTIONS="$MODLOGAN_OPTIONS"
  173. MODLOGAN_TAIL="$MODLOGAN_TAIL"
  174. AWSTATS_OPTIONS="$AWSTATS_OPTIONS"
  175. fi
  176. if [ $stamp = "init" ]; then
  177. [ $DEBUG ] && echo "$WEBSITE: Purge STATSDIR"
  178. rm -rf $STATSDIR
  179. mkdir $STATSDIR
  180. fi
  181. LOGDATARESOLVED="$STATSDIR/rawlog_old.txt"
  182. LOGDATA="$STATSDIR/rawlog_new.txt"
  183. LOGDATATMP="$STATSDIR/rawlog_incoming.txt"
  184. touch $LOGDATARESOLVED $LOGDATA $LOGDATATMP || exit1 "Couldn't touch LOGDATA files."
  185. #FIXME run init if folders doesn't exist
  186. if [ $stamp = "init" ]; then
  187. logcontentresolved $LOGROOT $WEBROOT $WEBSITE >> $LOGDATARESOLVED
  188. if [ -x $ANALOG_BIN ]; then
  189. [ $DEBUG ] && echo "$WEBSITE: Create/update analog config"
  190. echo "\
  191. # NB! This file is automatically generated. Do not edit directly!
  192. # Instead, put additions/overrides in $ANALOG_CFG.local
  193. HOSTNAME $HOST.$DOMAIN
  194. HOSTURL http://$HOST.$DOMAIN/
  195. BASEURL http://$HOST.$DOMAIN
  196. LANGUAGE DANISH
  197. "\
  198. > $ANALOG_CFG
  199. [ -s $ANALOG_CFG.local ] && cat $ANALOG_CFG.local >> $ANALOG_CFG
  200. [ -d $STATSDIR/analog ] || mkdir $STATSDIR/analog
  201. [ $DEBUG ] && echo "$WEBSITE: Create initial analog stats"
  202. rm -f $STATSDIR/analog/cache.data
  203. $ANALOG_BIN $ANALOG_OPTIONS -C"LOGFILE none" -C"LOGFILE $LOGDATARESOLVED" -C"CACHEOUTFILE $STATSDIR/analog/cache.data" -C"OUTFILE $STATSDIR/analog/index.html"
  204. fi
  205. if [ -x $RMAGIC_BIN -a -x $ANALOG_BIN ]; then
  206. [ $DEBUG ] && echo "$WEBSITE: Create/update Report Magic config"
  207. echo "\
  208. # NB! This file is automatically generated. Do not edit directly!
  209. # Instead, put additions/overrides in $RMAGIC_CFG.local
  210. [statistics]
  211. File_In = $STATSDIR/rmagic/report.dat
  212. Frame_File_Out = $STATSDIR/rmagic/index.html
  213. Language = en
  214. [reports]
  215. File_Out = $STATSDIR/rmagic/
  216. [QUICK]
  217. Rows = ALL
  218. [navigation]
  219. File_Out = navfile.html
  220. "\
  221. > $RMAGIC_CFG
  222. [ -s $RMAGIC_CFG.local ] && $RMAGIC_OPTIONS="$RMAGIC_OPTIONS -statistics_Include=$RMAGIC_CFG.local"
  223. [ -d $STATSDIR/rmagic ] || mkdir $STATSDIR/rmagic
  224. [ $DEBUG ] && echo "$WEBSITE: Create initial Report Magic stats"
  225. $ANALOG_BIN $ANALOG_OPTIONS -C"LOGFILE none" -C"CACHEFILE $STATSDIR/analog/cache.data" -C"LANGUAGE ENGLISH" -C"OUTPUT COMPUTER" -C"OUTFILE $STATSDIR/rmagic/report.dat"
  226. $RMAGIC_BIN $RMAGIC_OPTIONS $RMAGIC_CFG
  227. fi
  228. if [ -x $WEBALIZER_BIN ]; then
  229. [ $DEBUG ] && echo "$WEBSITE: Create/update Webalizer config"
  230. echo "\
  231. # NB! This file is automatically generated. Do not edit directly!
  232. # Instead, put additions/overrides in $WEBALIZER_CFG.local
  233. HostName $HOST.$DOMAIN
  234. HideSite *$DOMAIN
  235. HideReferrer $DOMAIN/
  236. "\
  237. > $WEBALIZER_CFG
  238. [ -s $WEBALIZER_CFG.local ] && cat $WEBALIZER_CFG.local >> $WEBALIZER_CFG
  239. [ -d $STATSDIR/webalizer ] || mkdir $STATSDIR/webalizer
  240. [ $DEBUG ] && echo "$WEBSITE: Create initial Webalizer stats"
  241. cat $LOGDATARESOLVED | $WEBALIZER_BIN $WEBALIZER_OPTIONS -N 0 - || true
  242. fi
  243. if [ -x $MODLOGAN_BIN ]; then
  244. [ $DEBUG ] && echo "$WEBSITE: Create/update ModLogAn config"
  245. echo "\
  246. # NB! This file is automatically generated. Do not edit directly!
  247. # Instead, put additions/overrides in $MODLOGAN_CFG.local
  248. [global]
  249. includepath = /etc/modlogan
  250. include = modlogan.def.conf,global
  251. loadplugin = input_clf
  252. loadplugin = processor_web
  253. loadplugin = output_modlogan
  254. loadplugin = output_template
  255. statedir=$STATSDIR/modlogan
  256. incremental = 0
  257. debug_level = 0
  258. enable_resolver = 0
  259. #read_ahead_limit = 1
  260. var(outputdir, \$statedir)
  261. [processor_web]
  262. include = group.url.conf,group_exploits
  263. include = modlogan.def.conf,processor_web
  264. debug_searchengines = 0
  265. debug_visits = 0
  266. hidereferrer = \"\.${DOMAIN//./\.}/\"
  267. [output_modlogan]
  268. include = modlogan.def.conf, output_modlogan
  269. hostname = $HOST.$DOMAIN
  270. outputdir=\$outputdir
  271. [output_template]
  272. include = modlogan.def.conf, output_template
  273. include = modlogan.def.conf, output_template_reports_web
  274. include = modlogan.def.conf, output_template_menu_web
  275. template_path = /usr/local/share/modlogan/themes/
  276. template_name = basic
  277. variable = HOSTNAME,$HOST.$DOMAIN
  278. variable = CHARSET,iso-8859-1
  279. variable = LANGUAGE,da
  280. hostname = $HOST.$DOMAIN
  281. outputdir=\$outputdir-test
  282. [input_clf]
  283. include = modlogan.def.conf,input_clf
  284. inputfile = -
  285. "\
  286. > $MODLOGAN_CFG
  287. [ -s $MODLOGAN_CFG.local ] && cat $MODLOGAN_CFG.local >> $MODLOGAN_CFG
  288. for dir in $STATSDIR/modlogan $STATSDIR/modlogan-test; do
  289. [ -d $dir ] || mkdir $dir
  290. [ $ROOT ] && chown $user:$group $dir
  291. done
  292. [ $DEBUG ] && echo "$WEBSITE: Create initial ModLogAn stats"
  293. if [ $ROOT ]; then
  294. cat $LOGDATARESOLVED | su $user -c "$MODLOGAN_BIN $MODLOGAN_OPTIONS $MODLOGAN_TAIL"
  295. else
  296. cat $LOGDATARESOLVED | $MODLOGAN_BIN $MODLOGAN_OPTIONS $MODLOGAN_TAIL
  297. fi
  298. fi
  299. if [ -x $AWSTATS_BIN ]; then
  300. [ $DEBUG ] && echo "$WEBSITE: Create/update AWStats config"
  301. echo "\
  302. # NB! This file is automatically generated. Do not edit directly!
  303. # Instead, put additions/overrides in $AWSTATS_CFG.local
  304. LogFile=\"$LOGDATATMP\"
  305. LogFormat=1
  306. DNSLookup=0
  307. DirData=\"$STATSDIR/awstats\"
  308. AllowToUpdateStatsFromBrowser=0
  309. DirCgi=\"http://cgi.jones.dk/cgi-bin\"
  310. DirIcons=\"http://stats.jones.dk/awstats-icon\"
  311. SiteDomain=\"$FQDN_ESC\"
  312. HostAliases=\"$FQDN_ESC\"
  313. Lang=\"dk\"
  314. DirLang=\"/usr/share/awstats/lang\"
  315. DefaultFile=\"index.html\"
  316. SkipHosts=\"\"
  317. SkipFiles=\"\"
  318. ShowLinksOnUrl=1
  319. ShowFlagLinks=0
  320. "\
  321. >/etc/awstats/awstats.$WEBSITE.conf
  322. [ -d $STATSDIR/awstats ] || mkdir $STATSDIR/awstats
  323. [ $DEBUG ] && echo "$WEBSITE: Create initial AWStats stats"
  324. awstats_setlog /etc/awstats/awstats.$WEBSITE.conf $LOGDATARESOLVED
  325. $AWSTATS_BIN -config=$WEBSITE $AWSTATS_OPTIONS -output > $STATSDIR/awstats/index.html
  326. awstats_setlog /etc/awstats/awstats.$WEBSITE.conf $LOGDATATMP
  327. fi
  328. [ $DEBUG ] && echo "$WEBSITE: Compress DNS-resolved logdata"
  329. gzip -9 $LOGDATARESOLVED
  330. fi
  331. if [ -x $JDRESOLVE_BIN ]; then
  332. [ $DEBUG ] && echo "$WEBSITE: DNS-resolve new logdata using jdresolve"
  333. logcontent $LOGROOT $WEBROOT $WEBSITE | $JDRESOLVE_BIN $JDRESOLVE_OPTIONS - >> $LOGDATA
  334. elif [ -x $LOGRESOLVE_BIN ]; then
  335. [ $DEBUG ] && echo "$WEBSITE: DNS-resolve new logdata using logresolve"
  336. logcontent $LOGROOT $WEBROOT $WEBSITE | $LOGRESOLVE_BIN >> $LOGDATA
  337. else
  338. [ $DEBUG ] && echo "$WEBSITE: Merging new logdata without DNS-resolving (no resolver found)"
  339. logcontent $LOGROOT $WEBROOT $WEBSITE >> $LOGDATA
  340. fi
  341. if [ -s $LOGDATA ]; then
  342. if [ -x $ANALOG_BIN ]; then
  343. [ $DEBUG ] && echo "$WEBSITE: Update analog stats"
  344. $ANALOG_BIN $ANALOG_OPTIONS -C"LOGFILE none" -C"CACHEFILE $STATSDIR/analog/cache.data" -C"LOGFILE $LOGDATA" -C"OUTFILE $STATSDIR/analog/index.html"
  345. fi
  346. if [ -x $RMAGIC_BIN -a -x $ANALOG_BIN ]; then
  347. [ $DEBUG ] && echo "$WEBSITE: Update Report Magic stats"
  348. $ANALOG_BIN $ANALOG_OPTIONS -C"LOGFILE none" -C"CACHEFILE $STATSDIR/analog/cache.data" -C"LOGFILE $LOGDATA" -C"LANGUAGE ENGLISH" -C"OUTPUT COMPUTER" -C"OUTFILE $STATSDIR/rmagic/report.dat"
  349. $RMAGIC_BIN $RMAGIC_OPTIONS $RMAGIC_CFG
  350. fi
  351. if [ -x $WEBALIZER_BIN ]; then
  352. [ $DEBUG ] && echo "$WEBSITE: Update Webalog stats"
  353. cat $LOGDATA | $WEBALIZER_BIN $WEBALIZER_OPTIONS -N 0 -
  354. fi
  355. if [ -x $MODLOGAN_BIN ]; then
  356. [ $DEBUG ] && echo "$WEBSITE: Update ModLogAn stats"
  357. if [ $ROOT ]; then
  358. cat $LOGDATA | su $user -c "$MODLOGAN_BIN $MODLOGAN_OPTIONS $MODLOGAN_TAIL"
  359. else
  360. cat $LOGDATA | $MODLOGAN_BIN $MODLOGAN_OPTIONS $MODLOGAN_TAIL
  361. fi
  362. fi
  363. if [ -x $AWSTATS_BIN ]; then
  364. [ $DEBUG ] && echo "$WEBSITE: Update AWStats stats"
  365. awstats_setlog /etc/awstats/awstats.$WEBSITE.conf $LOGDATA
  366. $AWSTATS_BIN -config=$WEBSITE $AWSTATS_OPTIONS -output > $STATSDIR/awstats/index.html
  367. awstats_setlog /etc/awstats/awstats.$WEBSITE.conf $LOGDATATMP
  368. fi
  369. gzip -f9 $LOGDATA
  370. fi
  371. if [ $stamp = "init" ]; then
  372. [ $DEBUG ] && echo "Execute $WEBSITE POST_INIT"
  373. post_init $LOGROOT $WEBROOT $WEBSITE || exit1 "Error executing POST_INIT."
  374. fi
  375. if [ $stamp = "update" ]; then
  376. [ $DEBUG ] && echo "Execute $WEBSITE POST_UPDATE"
  377. post_update $LOGROOT $WEBROOT $WEBSITE || exit1 "Error executing POST_UPDATE."
  378. fi
  379. done