add default sleep value and update README.md
This commit is contained in:
parent
271994965f
commit
f8896a5dea
13
README.md
13
README.md
|
|
@ -3,18 +3,17 @@
|
||||||
Base on Ubuntu, using Docker to construct your Apt mirror HTTP server
|
Base on Ubuntu, using Docker to construct your Apt mirror HTTP server
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
Using default [mirror.list!](mirror.list)
|
Running command
|
||||||
```
|
|
||||||
docker run -v /path/data:/var/spool/apt-mirror \
|
|
||||||
-d -p port_number:80 seterrychen/apt-mirror-http-server
|
|
||||||
```
|
|
||||||
|
|
||||||
Using your mirror.list
|
|
||||||
```
|
```
|
||||||
docker run -v /path/data:/var/spool/apt-mirror \
|
docker run -v /path/data:/var/spool/apt-mirror \
|
||||||
-v /path/your/mirror.list:/etc/apt/mirror.list \
|
-v /path/your/mirror.list:/etc/apt/mirror.list \
|
||||||
|
-e TIMEOUT=timeout-value
|
||||||
-d -p port_number:80 seterrychen/apt-mirror-http-server
|
-d -p port_number:80 seterrychen/apt-mirror-http-server
|
||||||
```
|
```
|
||||||
|
/path/data is where to store data, and the TIMEOUT var to repeatedly execute apt-mirror.
|
||||||
|
|
||||||
|
If you don't setting variable of mirror.list and TIMEOUT, it will using the default [mirror.list](mirror.list), and
|
||||||
|
the default TIMEOUT is 6 hours. To see the [TIMEOUT format description](http://www.cyberciti.biz/faq/linux-unix-sleep-bash-scripting/)
|
||||||
|
|
||||||
## Note
|
## Note
|
||||||
It will take time to download, then start http server. Using ``docker logs -f container-id`` to check the process.
|
It will take time to download, then start http server. Using ``docker logs -f container-id`` to check the process.
|
||||||
|
|
|
||||||
6
setup.sh
6
setup.sh
|
|
@ -5,6 +5,7 @@ mkdir /var/www/package
|
||||||
sed -i '12s/DocumentRoot \/var\/www\/html/DocumentRoot \/var\/www\/package/' /etc/apache2/sites-enabled/000-default.conf
|
sed -i '12s/DocumentRoot \/var\/www\/html/DocumentRoot \/var\/www\/package/' /etc/apache2/sites-enabled/000-default.conf
|
||||||
service apache2 restart
|
service apache2 restart
|
||||||
|
|
||||||
|
UNIT=${TIMEOUT:-12h}
|
||||||
while true; do
|
while true; do
|
||||||
|
|
||||||
# parse mirror.list to share under /var/www/package path
|
# parse mirror.list to share under /var/www/package path
|
||||||
|
|
@ -20,7 +21,8 @@ while true; do
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
printf "\n\n====== wait $TIMEOUT to execute apt-mirror command ======\n\n"
|
|
||||||
sleep $TIMEOUT
|
|
||||||
apt-mirror
|
apt-mirror
|
||||||
|
printf "\n\n====== wait $UNIT to execute apt-mirror again ======\n\n"
|
||||||
|
sleep $UNIT
|
||||||
|
|
||||||
done
|
done
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue