slitaz-modular rev 97
Now just add lines for crond if the website in question is used. Made sure the command is also run before being added. Ex. tazpkg-web cooking needs to be run for pkgs.slitaz.org to work locally.
author | Christopher Rogers <slaxemulator@gmail.com> |
---|---|
date | Wed May 11 13:33:29 2011 +0000 (2011-05-11) |
parents | 8b4268fe8048 |
children | d672aef40303 |
files | initramfs/usr/bin/local-mirror |
line diff
1.1 --- a/initramfs/usr/bin/local-mirror Wed May 11 13:27:12 2011 +0000 1.2 +++ b/initramfs/usr/bin/local-mirror Wed May 11 13:33:29 2011 +0000 1.3 @@ -77,6 +77,8 @@ 1.4 website) 1.5 [ -d $REPOS_DIR/$b ] && ln -s $REPOS_DIR/$b $MAIN_WWW_DIR 1.6 if [ -f $MAIN_WWW_DIR/$b/libs/get-latest.sh ]; then 1.7 + # run it here on first run 1.8 + $MAIN_WWW_DIR/$b/libs/get-latest.sh 1.9 if [ ! $(grep -l "$MAIN_WWW_DIR/$b/libs/get-latest.sh" $CRON_FILE) ]; then 1.10 echo "#Update SliTaz stuff" >> $CRON_FILE 1.11 echo "*/20 * * * * $MAIN_WWW_DIR/$b/libs/get-latest.sh" >> $CRON_FILE 1.12 @@ -160,6 +162,14 @@ 1.13 [ -d $STABLE/clean-wok ] || ln -sf $REPOS_DIR/wok-stable $STABLE/clean-wok 1.14 [ -d $PKGDIR ] && ln -sf $PKGDIR $LOCAL_REPOSITORY/packages 1.15 [ -d $SRCDIR ] && ln -sf $SRCDIR $LOCAL_REPOSITORY/src 1.16 + 1.17 + if [ -f "/usr/bin/tazpkg-web" ]; then 1.18 + tazpkg-web cooking 1.19 + if [ ! $(grep -l "/usr/bin/tazpkg-web cooking" $CRON_FILE) ]; then 1.20 + echo "# Update pkgs.slitaz.org pages" >> $CRON_FILE 1.21 + echo "20 02 * * * /usr/bin/tazpkg-web cooking" >> $CRON_FILE 1.22 + fi 1.23 + fi 1.24 ;; 1.25 mirror) 1.26 [ -d $REPOS_DIR/slitaz-dev-tools/mirror-tools/mirror-info ] && cp -a $REPOS_DIR/slitaz-dev-tools/mirror-tools/mirror-info $MAIN_WWW_DIR 1.27 @@ -189,6 +199,18 @@ 1.28 mkdir -p $dirlog 1.29 fi 1.30 done 1.31 + if [ -f /usr/share/awstats/extras/update ]; then 1.32 + if [ ! $(grep -l "/usr/share/awstats/extras/update" $CRON_FILE) ]; then 1.33 + echo "# Update Web stats" >> $CRON_FILE 1.34 + echo "*/5 * * * * /usr/share/awstats/extras/update" >> $CRON_FILE 1.35 + fi 1.36 + fi 1.37 + if [ -f $MAIN_WWW_DIR/tank/bin/makegraphs ]; then 1.38 + if [ ! $(grep -l "$MAIN_WWW_DIR/tank/bin/makegraphs" $CRON_FILE) ]; then 1.39 + echo "# Update system load graphics" >> $CRON_FILE 1.40 + echo "*/5 * * * * $MAIN_WWW_DIR/tank/bin/makegraphs" >> $CRON_FILE 1.41 + fi 1.42 + fi 1.43 ;; 1.44 hg) 1.45 [ -d $MAIN_WWW_DIR/hg ] || mkdir -p $MAIN_WWW_DIR/hg 1.46 @@ -214,8 +236,7 @@ 1.47 fi 1.48 if [ ! -f $REPOS_DIR/$repo/.hg/hgrc-web ]; then 1.49 touch $REPOS_DIR/$repo/.hg/hgrc-web 1.50 - echo "[paths]" >> $REPOS_DIR/$repo/.hg/hgrc-web 1.51 - echo "default = http://hg.slitaz.org/$repo/" >> $REPOS_DIR/$repo/.hg/hgrc-web 1.52 + cat "$REPOS_DIR/$repo/.hg/hgrc" >> $REPOS_DIR/$repo/.hg/hgrc-web 1.53 echo "[web]" >> $REPOS_DIR/$repo/.hg/hgrc-web 1.54 #[ -d $REPOS_DIR/$repo/.hg ] && echo "style = slitaz" >> $REPOS_DIR/$repo/.hg/hgrc-web 1.55 echo "staticurl = http://hg.slitaz.org/static/" >> $REPOS_DIR/$repo/.hg/hgrc-web 1.56 @@ -230,8 +251,10 @@ 1.57 fi 1.58 1.59 if [ ! $(grep -l 'contact = ' $REPOS_DIR/$repo/.hg/hgrc ) ]; then 1.60 + [ "$repo" = "cookutils" ] && echo "contact = Christophe Lincoln" >> $REPOS_DIR/$repo/.hg/hgrc 1.61 [ "$repo" = "flavors" ] && echo "contact = Christophe Lincoln" >> $REPOS_DIR/$repo/.hg/hgrc 1.62 [ "$repo" = "flavors-stable" ] && echo "contact = Pascal Bellard" >> $REPOS_DIR/$repo/.hg/hgrc 1.63 + [ "$repo" = "my-wok" ] && echo "contact = Christopher Rogers" >> $REPOS_DIR/$repo/.hg/hgrc 1.64 [ "$repo" = "slitaz-base-files" ] && echo "contact = Pascal Bellard" >> $REPOS_DIR/$repo/.hg/hgrc 1.65 [ "$repo" = "slitaz-boot-scripts" ] && echo "contact = Christophe Lincoln" >> $REPOS_DIR/$repo/.hg/hgrc 1.66 [ "$repo" = "slitaz-configs" ] && echo "contact = Christophe Lincoln" >> $REPOS_DIR/$repo/.hg/hgrc 1.67 @@ -256,6 +279,7 @@ 1.68 fi 1.69 1.70 if [ ! $(grep -l 'description = ' $REPOS_DIR/$repo/.hg/hgrc) ]; then 1.71 + [ "$repo" = "cookutils" ] && echo "description = Utils to cook SliTaz packages" >> $REPOS_DIR/$repo/.hg/hgrc 1.72 [ "$repo" = "flavors" ] && echo "description = SliTaz Cooking flavors" >> $REPOS_DIR/$repo/.hg/hgrc 1.73 [ "$repo" = "flavors-stable" ] && echo "description = SliTaz Stable flavors" >> $REPOS_DIR/$repo/.hg/hgrc 1.74 [ "$repo" = "slitaz-base-files" ] && echo "description = SliTaz base files" >> $REPOS_DIR/$repo/.hg/hgrc 1.75 @@ -301,24 +325,6 @@ 1.76 echo "$IP_ADDR $hostname" >> /etc/hosts 1.77 fi 1.78 done 1.79 - if [ -f /usr/share/awstats/extras/update ]; then 1.80 - if [ ! $(grep -l "/usr/share/awstats/extras/update" $CRON_FILE) ]; then 1.81 - echo "# Update Web stats" >> $CRON_FILE 1.82 - echo "*/5 * * * /usr/share/awstats/extras/update" >> $CRON_FILE 1.83 - fi 1.84 - fi 1.85 - if [ -f $MAIN_WWW_DIR/tank/bin/makegraphs ]; then 1.86 - if [ ! $(grep -l "$MAIN_WWW_DIR/tank/bin/makegraphs" $CRON_FILE) ]; then 1.87 - echo "# Update system load graphics" >> $CRON_FILE 1.88 - echo "*/5 * * * * $MAIN_WWW_DIR/tank/bin/makegraphs" >> $CRON_FILE 1.89 - fi 1.90 - fi 1.91 - if [ -f "/usr/bin/tazpkg-web" ]; then 1.92 - if [ ! $(grep -l "/usr/bin/tazpkg-web cooking" $CRON_FILE) ]; then 1.93 - echo "# Update pkgs.slitaz.org pages" >> $CRON_FILE 1.94 - echo "20 02 * * * /usr/bin/tazpkg-web cooking" >> $CRON_FILE 1.95 - fi 1.96 - fi 1.97 if [ "$IP_ADDR" != "127.0.0.1" ]; then 1.98 if [ ! $(grep -l "dhcp-option=option:router,$ROUTER_IP" /etc/dnsmasq.conf) ]; then 1.99 echo "$IP_ADDR tazpanel tazpanel.slitaz.org" >> /etc/hosts