slitaz-modular rev 146
local-mirror: Use makegraphs only once for mirror and tank graphs pages.
author | Christopher Rogers <slaxemulator@gmail.com> |
---|---|
date | Wed Nov 16 16:15:10 2011 +0000 (2011-11-16) |
parents | 82ef65096a7e |
children | 5f1950d053b2 |
files | initramfs/usr/bin/local-mirror |
line diff
1.1 --- a/initramfs/usr/bin/local-mirror Tue Nov 15 11:11:18 2011 +0000 1.2 +++ b/initramfs/usr/bin/local-mirror Wed Nov 16 16:15:10 2011 +0000 1.3 @@ -226,10 +226,12 @@ 1.4 [ -d $PKGDIR ] && ln -sf $PKGDIR $MAIN_WWW_DIR/slitaz/mirror/packages/$version 1.5 [ -d /var/www/slitaz ] || ln -sf $MAIN_WWW_DIR/slitaz /var/www/slitaz 1.6 [ -d /var/www/mirror-info ] || ln -sf $MAIN_WWW_DIR/mirror-info /var/www/mirror-info 1.7 - if [ -f /var/www/mirror-info/bin/makegraphs ]; then 1.8 - if [ ! $(grep -l "/var/www/mirror-info/bin/makegraphs" $CRON_FILE) ]; then 1.9 - echo "# Update mirror system load graphics" >> $CRON_FILE 1.10 - echo "*/5 * * * * /var/www/mirror-info/bin/makegraphs" >> $CRON_FILE 1.11 + [ -d $MAIN_WWW_DIR/mirror-info/pics ] || mkdir -p $MAIN_WWW_DIR/mirror-info/pics 1.12 + [ -d $MAIN_WWW_DIR/mirror-info/pics/rrd ] || ln -sf $MAIN_WWW_DIR/pics/rrd $MAIN_WWW_DIR/mirror-info/pics/rrd 1.13 + if [ -f /usr/bin/makegraphs ]; then 1.14 + if [ ! $(grep -l "/usr/bin/makegraphs" $CRON_FILE) ]; then 1.15 + echo "# Update system load graphics" >> $CRON_FILE 1.16 + echo "*/5 * * * * /usr/bin/makegraphs" >> $CRON_FILE 1.17 fi 1.18 fi 1.19 ;; 1.20 @@ -247,16 +249,18 @@ 1.21 mkdir -p $dirlog 1.22 fi 1.23 done 1.24 + [ -d $MAIN_WWW_DIR/$b/pics ] || mkdir -p $MAIN_WWW_DIR/$b/pics 1.25 + [ -d $MAIN_WWW_DIR/$b/pics/rrd ] || ln -sf $MAIN_WWW_DIR/pics/rrd $MAIN_WWW_DIR/$b/pics/rrd 1.26 if [ -f /usr/share/awstats/extras/update ]; then 1.27 if [ ! $(grep -l "/usr/share/awstats/extras/update" $CRON_FILE) ]; then 1.28 echo "# Update Web stats" >> $CRON_FILE 1.29 echo "*/5 * * * * /usr/share/awstats/extras/update" >> $CRON_FILE 1.30 fi 1.31 fi 1.32 - if [ -f $MAIN_WWW_DIR/tank/bin/makegraphs ]; then 1.33 - if [ ! $(grep -l "$MAIN_WWW_DIR/tank/bin/makegraphs" $CRON_FILE) ]; then 1.34 - echo "# Update tank system load graphics" >> $CRON_FILE 1.35 - echo "*/5 * * * * $MAIN_WWW_DIR/tank/bin/makegraphs" >> $CRON_FILE 1.36 + if [ -f /usr/bin/makegraphs ]; then 1.37 + if [ ! $(grep -l "/usr/bin/makegraphs" $CRON_FILE) ]; then 1.38 + echo "# Update system load graphics" >> $CRON_FILE 1.39 + echo "*/5 * * * * /usr/bin/makegraphs" >> $CRON_FILE 1.40 fi 1.41 fi 1.42 ;; 1.43 @@ -430,8 +434,9 @@ 1.44 else 1.45 [ -f $VHOST_FILE ] && ln -sf $VHOST_FILE /etc/lighttpd/vhosts.conf 1.46 fi 1.47 - chown -R www.www $SLITAZ_DIR/www 1.48 - up_src_links 1.49 + [ -d $MAIN_WWW_DIR/pics/rrd ] || mkdir -p $MAIN_WWW_DIR/pics/rrd 1.50 + chown -R www.www $MAIN_WWW_DIR 1.51 + up_src_links 1.52 [ -x /etc/init.d/lighttpd ] && /etc/init.d/lighttpd start 1.53 [ -x /etc/init.d/crond ] && /etc/init.d/crond start 1.54 ;;