slitaz-modular rev 32

Update local-mirror script. Add on and off options. Put if statement of WWW and for loop of REPOS into functions.
author Christopher Rogers <slaxemulator@gmail.com>
date Mon Feb 28 14:49:41 2011 +0000 (2011-02-28)
parents e97122839ed8
children 5416781d4a7e
files initramfs/etc/local-mirror.conf initramfs/usr/bin/local-mirror
line diff
     1.1 --- a/initramfs/etc/local-mirror.conf	Mon Feb 28 14:27:31 2011 +0000
     1.2 +++ b/initramfs/etc/local-mirror.conf	Mon Feb 28 14:49:41 2011 +0000
     1.3 @@ -1,6 +1,7 @@
     1.4  REPOS="flavors flavors-stable slitaz-base-files \
     1.5 - slitaz-boot-scripts slitaz-dev-tools slitaz-configs slitaz-doc slitaz-forge \
     1.6 - slitaz-pizza slitaz-tools tank tazlito tazpkg tazusb \
     1.7 + slitaz-boot-scripts slitaz-dev-tools slitaz-configs slitaz-doc \
     1.8 + slitaz-doc-wiki-data slitaz-forge slitaz-modular slitaz-pizza \
     1.9 + slitaz-tools tank tazlito tazpkg tazusb \
    1.10   tazwok slitaz-dev-tools website wok wok-stable wok-tiny \
    1.11   wok-undigest"
    1.12  WWW="tank hg mirror pkgs bb doc website people"
     2.1 --- a/initramfs/usr/bin/local-mirror	Mon Feb 28 14:27:31 2011 +0000
     2.2 +++ b/initramfs/usr/bin/local-mirror	Mon Feb 28 14:49:41 2011 +0000
     2.3 @@ -1,23 +1,42 @@
     2.4  #!/bin/sh
     2.5  
     2.6 +source /usr/lib/slitaz/libtaz
     2.7 +source_lib commons
     2.8 +check_root
     2.9 +
    2.10  . /etc/local-mirror.conf
    2.11  
    2.12 +VERSION="0.1"
    2.13 +COMMAND="$1"
    2.14 +
    2.15 +usage() {
    2.16 +	echo "$0 $VERSION"
    2.17 +	echo "$0 [on|off]"
    2.18 +	exit 1 
    2.19 +}
    2.20 +
    2.21  [ -d $REPOS_DIR ] || continue
    2.22  [ -d $WWW_DIR ] || mkdir -p $WWW_DIR
    2.23 -ln -sf /home/slitaz/www /var/www/vhosts
    2.24 -for b in $WWW; do
    2.25 -    [ -d $WWW_DIR/$b ] && continue
    2.26 -    if [ "$b" = "website" ]; then
    2.27 +[ -L /var/www/vhosts ] || ln -sf $WWW_DIR /var/www/vhosts
    2.28 +
    2.29 +www() {
    2.30 +	b=$1
    2.31 +	if [ "$b" = "website" ]; then
    2.32  		[ -d $REPOS_DIR/$b ] && ln -s $REPOS_DIR/$b $WWW_DIR
    2.33  	fi
    2.34  	if [ "$b" = "people" ]; then
    2.35 -		[ -d $REPOS_DIR/slitaz-forge/people ] && ln -sf $REPOS_DIR/slitaz-forge/people $WWW_DIR
    2.36 +		[ -d $REPOS_DIR/slitaz-forge/people ] && ln -s $REPOS_DIR/slitaz-forge/people $WWW_DIR/people
    2.37  	fi
    2.38  	if [ "$b" = "doc" ]; then
    2.39 -		[ -d $REPOS_DIR/slitaz-forge/doc ] && ln -sf $REPOS_DIR/slitaz-forge/doc $WWW_DIR
    2.40 -		[ -d /var/www/dokuwiki ] && cp -a /var/www/dokuwiki/* $REPOS_DIR/slitaz-forge/doc
    2.41 -		chown root.root -R $REPOS_DIR/slitaz-forge/doc
    2.42 -		chmod 777 -R $REPOS_DIR/slitaz-forge/doc
    2.43 +		[ -d $REPOS_DIR/slitaz-forge/doc ] && cp -a $REPOS_DIR/slitaz-forge/doc $WWW_DIR/doc
    2.44 +		[ -d /var/www/dokuwiki ] && cp -a /var/www/dokuwiki/* $WWW_DIR/doc
    2.45 +		VAR="index media pages"
    2.46 +		for i in $VAR; do
    2.47 +			[ -d $REPOS_DIR/slitaz-doc-wiki-data ] && cp -a $REPOS_DIR/slitaz-doc-wiki-data/$i $WWW_DIR/doc/data
    2.48 +		done
    2.49 +		[ -d $REPOS_DIR/slitaz-doc-wiki-data/plugins ] && cp -a $REPOS_DIR/slitaz-doc-wiki-data/plugins  $WWW_DIR/doc/lib
    2.50 +		chown root.root -R $WWW_DIR/doc
    2.51 +		chmod 777 -R $WWW_DIR/doc
    2.52  	fi
    2.53  	if [ "$b" = "bb" ]; then
    2.54  		[ -d /usr/share/slitaz/web-bb ] && cp -a /usr/share/slitaz/web-bb $WWW_DIR/bb
    2.55 @@ -36,105 +55,131 @@
    2.56  		[ -d /boot/src ] && ln -sf /boot/src /home/slitaz/$(cat /etc/slitaz-release)/src
    2.57  	fi
    2.58  	if [ "$b" = "mirror" ]; then
    2.59 -		[ -d $REPOS_DIR/slitaz-dev-tools/mirror-tools/mirror-info ] && ln -sf $REPOS_DIR/slitaz-dev-tools/mirror-tools/mirror-info $WWW_DIR/mirror-info
    2.60 -		[ -d $REPOS_DIR/slitaz-dev-tools/mirror-tools/slitaz ] && ln -sf $REPOS_DIR/slitaz-dev-tools/mirror-tools/slitaz $WWW_DIR/slitaz
    2.61 -		[ -d /boot/packages ] && ln -sf /boot/packages $WWW_DIR/slitaz/mirror/packages
    2.62 -		[ -d /boot/src ] && ln -sf /boot/src $WWW_DIR/slitaz/mirror/src
    2.63 +		[ -d $REPOS_DIR/slitaz-dev-tools/mirror-tools/mirror-info ] && cp -a $REPOS_DIR/slitaz-dev-tools/mirror-tools/mirror-info $WWW_DIR
    2.64 +		[ -d $REPOS_DIR/slitaz-dev-tools/mirror-tools/slitaz ] && cp -a $REPOS_DIR/slitaz-dev-tools/mirror-tools/slitaz $WWW_DIR
    2.65 +		[ -d $WWW_DIR/slitaz/mirror/packages ] || mkdir -p $WWW_DIR/slitaz/mirror/packages
    2.66 +		[ -d /boot/packages ] && ln -sf /boot/packages $WWW_DIR/slitaz/mirror/packages/$(cat /etc/slitaz-release)
    2.67 +		if [ -d /boot/src ]; then
    2.68 +			for i in $(ls /boot/src); do
    2.69 +				[ -d $WWW_DIR/slitaz/mirror/sources/packages/${i:0:1} ] || mkdir -p $WWW_DIR/slitaz/mirror/sources/packages/${i:0:1}
    2.70 +				ln -sf /boot/src/$i $WWW_DIR/slitaz/mirror/sources/packages/${i:0:1}/$i
    2.71 +			done
    2.72 +		fi
    2.73  	fi
    2.74  	if [ "$b" = "tank" ]; then
    2.75  		[ -d $REPOS_DIR/slitaz-forge/$b/web ] && ln -sf $REPOS_DIR/slitaz-forge/$b/web $WWW_DIR/$b
    2.76 +		[ -f /usr/share/awstats/extras/update ] && ln -sf /usr/share/awstats/extras/update /usr/sbin/awsupdate_all
    2.77 +		[ -d $REPOS_DIR/slitaz-forge/$b/root/etc/awstats ] && cp -a $REPOS_DIR/slitaz-forge/$b/root/etc/awstats/* /etc/awstats
    2.78  	fi
    2.79  	if [ "$b" = "hg" ]; then
    2.80  		[ -d $WWW_DIR/hg ] || mkdir -p $WWW_DIR/hg
    2.81  		[ -f /usr/share/examples/mercurial/hgwebdir.cgi ] && ln -sf /usr/share/examples/mercurial/hgwebdir.cgi $WWW_DIR/hg
    2.82  		[ -f $REPOS_DIR/slitaz-forge/tank/files/etc/mercurial/hgweb.config ] && ln -sf $REPOS_DIR/slitaz-forge/tank/files/etc/mercurial/hgweb.config /etc/mercurial/hgweb.config
    2.83  	fi
    2.84 -done
    2.85 +}
    2.86  
    2.87 -for repo in $REPOS; do
    2.88 -	[ -d $REPOS_DIR/$repo ] || continue
    2.89 -	if [ "$repo" = "flavors" ]; then
    2.90 -		[ -d $REPOS_DIR/$repo ] && ln -sf $REPOS_DIR/$repo $COOKING/$repo
    2.91 -	fi
    2.92 -	if [ "$repo" = "flavors-stable" ]; then
    2.93 -		[ -d $REPOS_DIR/$repo ] && ln -sf $REPOS_DIR/$repo $STABLE/$repo
    2.94 -	fi
    2.95 -	if [ ! -f $REPOS_DIR/$repo/.hg/hgrc-web ]; then
    2.96 -		[ -d $REPOS_DIR/$repo/.hg ] && touch $REPOS_DIR/$repo/.hg/hgrc-web
    2.97 -		[ -d $REPOS_DIR/$repo/.hg ] && echo "[web]" >> $REPOS_DIR/$repo/.hg/hgrc-web
    2.98 -		[ -d $REPOS_DIR/$repo/.hg ] && echo "style = slitaz" >> $REPOS_DIR/$repo/.hg/hgrc-web
    2.99 -		[ -d $REPOS_DIR/$repo/.hg ] && echo "push_ssl = false" >> $REPOS_DIR/$repo/.hg/hgrc-web
   2.100 -		[ -d $REPOS_DIR/$repo/.hg ] && echo "allow_push = *" >> $REPOS_DIR/$repo/.hg/hgrc-web
   2.101 -		[ ! -f $REPOS_DIR/$repo/.hg/hgrc-pull ] && mv $REPOS_DIR/$repo/.hg/hgrc $REPOS_DIR/$repo/.hg/hgrc-pull
   2.102 -		[ ! -f $REPOS_DIR/$repo/.hg/hgrc ] && cp -a $REPOS_DIR/$repo/.hg/hgrc-web $REPOS_DIR/$repo/.hg/hgrc
   2.103 -	fi
   2.104 +repos() {
   2.105 +	for repo in $REPOS; do
   2.106 +		[ -d $REPOS_DIR/$repo ] || continue
   2.107 +		if [ "$repo" = "flavors" ]; then
   2.108 +			[ -d $COOKING ] || mkdir -p $COOKING
   2.109 +			[ -d $REPOS_DIR/$repo ] && ln -sf $REPOS_DIR/$repo $COOKING/$repo
   2.110 +		fi
   2.111 +		if [ "$repo" = "flavors-stable" ]; then
   2.112 +			[ -d $STABLE ] || mkdir -p $STABLE
   2.113 +			[ -d $REPOS_DIR/$repo ] && ln -sf $REPOS_DIR/$repo $STABLE/$repo
   2.114 +		fi
   2.115 +		if [ ! -f $REPOS_DIR/$repo/.hg/hgrc-web ]; then
   2.116 +			[ -d $REPOS_DIR/$repo/.hg ] && touch $REPOS_DIR/$repo/.hg/hgrc-web
   2.117 +			[ -d $REPOS_DIR/$repo/.hg ] && echo "[web]" >> $REPOS_DIR/$repo/.hg/hgrc-web
   2.118 +			[ -d $REPOS_DIR/$repo/.hg ] && echo "style = slitaz" >> $REPOS_DIR/$repo/.hg/hgrc-web
   2.119 +			[ -d $REPOS_DIR/$repo/.hg ] && echo "push_ssl = false" >> $REPOS_DIR/$repo/.hg/hgrc-web
   2.120 +			[ -d $REPOS_DIR/$repo/.hg ] && echo "allow_push = *" >> $REPOS_DIR/$repo/.hg/hgrc-web
   2.121 +			[ ! -f $REPOS_DIR/$repo/.hg/hgrc-pull ] && mv $REPOS_DIR/$repo/.hg/hgrc $REPOS_DIR/$repo/.hg/hgrc-pull
   2.122 +			[ ! -f $REPOS_DIR/$repo/.hg/hgrc ] && cp -a $REPOS_DIR/$repo/.hg/hgrc-web $REPOS_DIR/$repo/.hg/hgrc
   2.123 +		fi
   2.124  	
   2.125 -	if [ ! $(grep -l 'name = ' $REPOS_DIR/$repo/.hg/hgrc ) ]; then
   2.126 -		echo "name = $repo" >> $REPOS_DIR/$repo/.hg/hgrc
   2.127 -	fi
   2.128 +		if [ ! $(grep -l 'name = ' $REPOS_DIR/$repo/.hg/hgrc ) ]; then
   2.129 +			echo "name = $repo" >> $REPOS_DIR/$repo/.hg/hgrc
   2.130 +		fi
   2.131  	
   2.132 -	if [ ! $(grep -l 'contact = ' $REPOS_DIR/$repo/.hg/hgrc ) ]; then
   2.133 -		[ "$repo" = "flavors" ] && echo "contact = Christophe Lincoln" >> $REPOS_DIR/$repo/.hg/hgrc
   2.134 -		[ "$repo" = "flavors-stable" ] && echo "contact = Pascal Bellard" >> $REPOS_DIR/$repo/.hg/hgrc
   2.135 -		[ "$repo" = "slitaz-base-files" ] && echo "contact = Pascal Bellard" >> $REPOS_DIR/$repo/.hg/hgrc
   2.136 -		[ "$repo" = "slitaz-boot-scripts" ] && echo "contact = Christophe Lincoln" >> $REPOS_DIR/$repo/.hg/hgrc
   2.137 -		[ "$repo" = "slitaz-configs" ] && echo "contact = Christophe Lincoln" >> $REPOS_DIR/$repo/.hg/hgrc
   2.138 -		[ "$repo" = "slitaz-dev-tools" ] && echo "contact = Christophe Lincoln" >> $REPOS_DIR/$repo/.hg/hgrc
   2.139 -		[ "$repo" = "slitaz-doc" ] && echo "contact = Christophe Lincoln" >> $REPOS_DIR/$repo/.hg/hgrc
   2.140 -		[ "$repo" = "slitaz-forge" ] && echo "contact = Eric Joseph-Alexandre" >> $REPOS_DIR/$repo/.hg/hgrc
   2.141 -		[ "$repo" = "slitaz-pizza" ] && echo "contact = Pascal Bellard" >> $REPOS_DIR/$repo/.hg/hgrc
   2.142 -		[ "$repo" = "slitaz-tools" ] && echo "contact = Christophe Lincoln" >> $REPOS_DIR/$repo/.hg/hgrc
   2.143 -		[ "$repo" = "tazlito" ] && echo "contact = Pascal Bellard" >> $REPOS_DIR/$repo/.hg/hgrc
   2.144 -		[ "$repo" = "tazpkg" ] && echo "contact = Christophe Lincoln" >> $REPOS_DIR/$repo/.hg/hgrc
   2.145 -		[ "$repo" = "tazusb" ] && echo "contact = Eric Joseph-Alexandre" >> $REPOS_DIR/$repo/.hg/hgrc
   2.146 -		[ "$repo" = "tazwok" ] && echo "contact = Christophe Lincoln" >> $REPOS_DIR/$repo/.hg/hgrc
   2.147 -		[ "$repo" = "website" ] && echo "contact = Christophe Lincoln" >> $REPOS_DIR/$repo/.hg/hgrc
   2.148 -		[ "$repo" = "wok" ] && echo "contact = Christophe Lincoln" >> $REPOS_DIR/$repo/.hg/hgrc
   2.149 -		[ "$repo" = "wok-stable" ] && echo "contact = Christophe Lincoln" >> $REPOS_DIR/$repo/.hg/hgrc
   2.150 -		[ "$repo" = "wok-tiny" ] && echo "contact = Pascal Bellard" >> $REPOS_DIR/$repo/.hg/hgrc
   2.151 -		[ "$repo" = "wok-undigest" ] && echo "contact = Christophe Lincoln" >> $REPOS_DIR/$repo/.hg/hgrc
   2.152 -	fi
   2.153 +		if [ ! $(grep -l 'contact = ' $REPOS_DIR/$repo/.hg/hgrc ) ]; then
   2.154 +			[ "$repo" = "flavors" ] && echo "contact = Christophe Lincoln" >> $REPOS_DIR/$repo/.hg/hgrc
   2.155 +			[ "$repo" = "flavors-stable" ] && echo "contact = Pascal Bellard" >> $REPOS_DIR/$repo/.hg/hgrc
   2.156 +			[ "$repo" = "slitaz-base-files" ] && echo "contact = Pascal Bellard" >> $REPOS_DIR/$repo/.hg/hgrc
   2.157 +			[ "$repo" = "slitaz-boot-scripts" ] && echo "contact = Christophe Lincoln" >> $REPOS_DIR/$repo/.hg/hgrc
   2.158 +			[ "$repo" = "slitaz-configs" ] && echo "contact = Christophe Lincoln" >> $REPOS_DIR/$repo/.hg/hgrc
   2.159 +			[ "$repo" = "slitaz-dev-tools" ] && echo "contact = Christophe Lincoln" >> $REPOS_DIR/$repo/.hg/hgrc
   2.160 +			[ "$repo" = "slitaz-doc" ] && echo "contact = Christophe Lincoln" >> $REPOS_DIR/$repo/.hg/hgrc
   2.161 +			[ "$repo" = "slitaz-doc-wiki-data" ] && echo "contact = Christopher Rogers" >> $REPOS_DIR/$repo/.hg/hgrc
   2.162 +			[ "$repo" = "slitaz-forge" ] && echo "contact = Eric Joseph-Alexandre" >> $REPOS_DIR/$repo/.hg/hgrc
   2.163 +			[ "$repo" = "slitaz-modular" ] && echo "contact = Christopher Rogers" >> $REPOS_DIR/$repo/.hg/hgrc
   2.164 +			[ "$repo" = "slitaz-pizza" ] && echo "contact = Pascal Bellard" >> $REPOS_DIR/$repo/.hg/hgrc
   2.165 +			[ "$repo" = "slitaz-tools" ] && echo "contact = Christophe Lincoln" >> $REPOS_DIR/$repo/.hg/hgrc
   2.166 +			[ "$repo" = "tazlito" ] && echo "contact = Pascal Bellard" >> $REPOS_DIR/$repo/.hg/hgrc
   2.167 +			[ "$repo" = "tazpkg" ] && echo "contact = Christophe Lincoln" >> $REPOS_DIR/$repo/.hg/hgrc
   2.168 +			[ "$repo" = "tazusb" ] && echo "contact = Eric Joseph-Alexandre" >> $REPOS_DIR/$repo/.hg/hgrc
   2.169 +			[ "$repo" = "tazwok" ] && echo "contact = Christophe Lincoln" >> $REPOS_DIR/$repo/.hg/hgrc
   2.170 +			[ "$repo" = "website" ] && echo "contact = Christophe Lincoln" >> $REPOS_DIR/$repo/.hg/hgrc
   2.171 +			[ "$repo" = "wok" ] && echo "contact = Christophe Lincoln" >> $REPOS_DIR/$repo/.hg/hgrc
   2.172 +			[ "$repo" = "wok-stable" ] && echo "contact = Christophe Lincoln" >> $REPOS_DIR/$repo/.hg/hgrc
   2.173 +			[ "$repo" = "wok-tiny" ] && echo "contact = Pascal Bellard" >> $REPOS_DIR/$repo/.hg/hgrc
   2.174 +			[ "$repo" = "wok-undigest" ] && echo "contact = Christophe Lincoln" >> $REPOS_DIR/$repo/.hg/hgrc
   2.175 +		fi
   2.176  	
   2.177 -	if [ ! $(grep -l 'description = ' $REPOS_DIR/$repo/.hg/hgrc) ]; then
   2.178 -		[ "$repo" = "flavors" ] && echo "description = SliTaz Cooking flavors" >> $REPOS_DIR/$repo/.hg/hgrc
   2.179 -		[ "$repo" = "flavors-stable" ] && echo "description = SliTaz Stable flavors" >> $REPOS_DIR/$repo/.hg/hgrc
   2.180 -		[ "$repo" = "slitaz-base-files" ] && echo "description = SliTaz base files" >> $REPOS_DIR/$repo/.hg/hgrc
   2.181 -		[ "$repo" = "slitaz-boot-scripts" ] && echo "description = SliTaz boot scripts" >> $REPOS_DIR/$repo/.hg/hgrc
   2.182 -		[ "$repo" = "slitaz-configs" ] && echo "description = SliTaz configuration files" >> $REPOS_DIR/$repo/.hg/hgrc
   2.183 -		[ "$repo" = "slitaz-dev-tools" ] && echo "description = SliTaz Developers Tools" >> $REPOS_DIR/$repo/.hg/hgrc
   2.184 -		[ "$repo" = "slitaz-doc" ] && echo "description = SliTaz system doc" >> $REPOS_DIR/$repo/.hg/hgrc
   2.185 -		[ "$repo" = "slitaz-forge" ] && echo "description = SliTaz Forge Config" >> $REPOS_DIR/$repo/.hg/hgrc
   2.186 -		[ "$repo" = "slitaz-pizza" ] && echo "description = SliTaz Online flavor builder" >> $REPOS_DIR/$repo/.hg/hgrc
   2.187 -		[ "$repo" = "slitaz-tools" ] && echo "description = SliTaz Tools and Tinyutils" >> $REPOS_DIR/$repo/.hg/hgrc
   2.188 -		[ "$repo" = "tazlito" ] && echo "description = SliTaz Live Tool" >> $REPOS_DIR/$repo/.hg/hgrc
   2.189 -		[ "$repo" = "tazpkg" ] && echo "description = SliTaz Packages manager" >> $REPOS_DIR/$repo/.hg/hgrc
   2.190 -		[ "$repo" = "tazusb" ] && echo "description = SliTaz LiveUSB utility" >> $REPOS_DIR/$repo/.hg/hgrc
   2.191 -		[ "$repo" = "tazwok" ] && echo "description = Slitaz Packages builder" >> $REPOS_DIR/$repo/.hg/hgrc
   2.192 -		[ "$repo" = "website" ] && echo "description = SliTaz Website" >> $REPOS_DIR/$repo/.hg/hgrc
   2.193 -		[ "$repo" = "wok" ] && echo "description = SliTaz Cooking wok" >> $REPOS_DIR/$repo/.hg/hgrc
   2.194 -		[ "$repo" = "wok-stable" ] && echo "description = SliTaz Stable wok" >> $REPOS_DIR/$repo/.hg/hgrc
   2.195 -		[ "$repo" = "wok-tiny" ] && echo "description = Tiny SliTaz wok" >> $REPOS_DIR/$repo/.hg/hgrc
   2.196 -		[ "$repo" = "wok-undigest" ] && echo "description = SliTaz Undigest wok" >> $REPOS_DIR/$repo/.hg/hgrc
   2.197 -	fi
   2.198 -done
   2.199 +		if [ ! $(grep -l 'description = ' $REPOS_DIR/$repo/.hg/hgrc) ]; then
   2.200 +			[ "$repo" = "flavors" ] && echo "description = SliTaz Cooking flavors" >> $REPOS_DIR/$repo/.hg/hgrc
   2.201 +			[ "$repo" = "flavors-stable" ] && echo "description = SliTaz Stable flavors" >> $REPOS_DIR/$repo/.hg/hgrc
   2.202 +			[ "$repo" = "slitaz-base-files" ] && echo "description = SliTaz base files" >> $REPOS_DIR/$repo/.hg/hgrc
   2.203 +			[ "$repo" = "slitaz-boot-scripts" ] && echo "description = SliTaz boot scripts" >> $REPOS_DIR/$repo/.hg/hgrc
   2.204 +			[ "$repo" = "slitaz-configs" ] && echo "description = SliTaz configuration files" >> $REPOS_DIR/$repo/.hg/hgrc
   2.205 +			[ "$repo" = "slitaz-dev-tools" ] && echo "description = SliTaz Developers Tools" >> $REPOS_DIR/$repo/.hg/hgrc
   2.206 +			[ "$repo" = "slitaz-doc" ] && echo "description = SliTaz system doc" >> $REPOS_DIR/$repo/.hg/hgrc
   2.207 +			[ "$repo" = "slitaz-doc-wiki-data" ] && echo "description = SliTaz documentation wiki content" >> $REPOS_DIR/$repo/.hg/hgrc
   2.208 +			[ "$repo" = "slitaz-forge" ] && echo "description = SliTaz Forge Config" >> $REPOS_DIR/$repo/.hg/hgrc
   2.209 +			[ "$repo" = "slitaz-modular" ] && echo "description = Scripts to make SliTaz Modular" >> $REPOS_DIR/$repo/.hg/hgrc
   2.210 +			[ "$repo" = "slitaz-pizza" ] && echo "description = SliTaz Online flavor builder" >> $REPOS_DIR/$repo/.hg/hgrc
   2.211 +			[ "$repo" = "slitaz-tools" ] && echo "description = SliTaz Tools and Tinyutils" >> $REPOS_DIR/$repo/.hg/hgrc
   2.212 +			[ "$repo" = "tazlito" ] && echo "description = SliTaz Live Tool" >> $REPOS_DIR/$repo/.hg/hgrc
   2.213 +			[ "$repo" = "tazpkg" ] && echo "description = SliTaz Packages manager" >> $REPOS_DIR/$repo/.hg/hgrc
   2.214 +			[ "$repo" = "tazusb" ] && echo "description = SliTaz LiveUSB utility" >> $REPOS_DIR/$repo/.hg/hgrc
   2.215 +			[ "$repo" = "tazwok" ] && echo "description = Slitaz Packages builder" >> $REPOS_DIR/$repo/.hg/hgrc
   2.216 +			[ "$repo" = "website" ] && echo "description = SliTaz Website" >> $REPOS_DIR/$repo/.hg/hgrc
   2.217 +			[ "$repo" = "wok" ] && echo "description = SliTaz Cooking wok" >> $REPOS_DIR/$repo/.hg/hgrc
   2.218 +			[ "$repo" = "wok-stable" ] && echo "description = SliTaz Stable wok" >> $REPOS_DIR/$repo/.hg/hgrc
   2.219 +			[ "$repo" = "wok-tiny" ] && echo "description = Tiny SliTaz wok" >> $REPOS_DIR/$repo/.hg/hgrc
   2.220 +			[ "$repo" = "wok-undigest" ] && echo "description = SliTaz Undigest wok" >> $REPOS_DIR/$repo/.hg/hgrc
   2.221 +		fi
   2.222 +	done
   2.223 +}
   2.224  
   2.225 -for hostname in $ADDRESS; do 
   2.226 -	END_IP=$(($END_IP+1))
   2.227 -	for i in $END_IP; do
   2.228 -		if [ ! $(grep -l "${BASE_IP}.$i $hostname" /etc/hosts) ]; then
   2.229 -			echo "${BASE_IP}.$i $hostname" >> /etc/hosts
   2.230 -		fi
   2.231 -	done 
   2.232 -done
   2.233 +case "$COMMAND" in 
   2.234 +	on)
   2.235 +		for c in $WWW; do
   2.236 +			if [ ! -d $WWW_DIR/$c ]; then
   2.237 +				www $c
   2.238 +			fi
   2.239 +			[ "$c" = "hg" ] && repos
   2.240 +		done
   2.241 +		for hostname in $ADDRESS; do 
   2.242 +			END_IP=$(($END_IP+1))
   2.243 +			for i in $END_IP; do
   2.244 +				if [ ! $(grep -l "${BASE_IP}.$i $hostname" /etc/hosts) ]; then
   2.245 +					echo "${BASE_IP}.$i $hostname" >> /etc/hosts
   2.246 +				fi
   2.247 +			done 
   2.248 +		done
   2.249  
   2.250 -[ -f $VHOST_FILE ] && ln -sf $VHOST_FILE /etc/lighttpd/vhosts.conf
   2.251 -chown -R www.www /home/slitaz/www
   2.252 -
   2.253 -if [ "$1" = "on" ]; then
   2.254 -	[ -f /etc/init.d/lighttpd ] && /etc/init.d/lighttpd start
   2.255 -fi
   2.256 -
   2.257 -if [ "$1" = "off" ]; then
   2.258 -	[ -f /etc/init.d/lighttpd ] && /etc/init.d/lighttpd stop
   2.259 -	echo "127.0.0.1 localhost $(cat /etc/hostname)" > /etc/hosts
   2.260 -fi
   2.261 +		[ -f $VHOST_FILE ] && ln -sf $VHOST_FILE /etc/lighttpd/vhosts.conf
   2.262 +		chown -R www.www /home/slitaz/www
   2.263 +		[ -f /etc/init.d/lighttpd ] && /etc/init.d/lighttpd start
   2.264 +		;;
   2.265 +	off)
   2.266 +		[ -f /etc/init.d/lighttpd ] && /etc/init.d/lighttpd stop
   2.267 +		echo "127.0.0.1 localhost $(cat /etc/hostname)" > /etc/hosts
   2.268 +		exit 1
   2.269 +		;;
   2.270 +	*)
   2.271 +		usage
   2.272 +		;;
   2.273 +esac