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
|
||||
|
||||
## Usage
|
||||
Using default [mirror.list!](mirror.list)
|
||||
```
|
||||
docker run -v /path/data:/var/spool/apt-mirror \
|
||||
-d -p port_number:80 seterrychen/apt-mirror-http-server
|
||||
```
|
||||
|
||||
Using your mirror.list
|
||||
Running command
|
||||
```
|
||||
docker run -v /path/data:/var/spool/apt-mirror \
|
||||
-v /path/your/mirror.list:/etc/apt/mirror.list \
|
||||
-e TIMEOUT=timeout-value
|
||||
-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
|
||||
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
|
||||
service apache2 restart
|
||||
|
||||
UNIT=${TIMEOUT:-12h}
|
||||
while true; do
|
||||
|
||||
# parse mirror.list to share under /var/www/package path
|
||||
|
|
@ -20,7 +21,8 @@ while true; do
|
|||
fi
|
||||
done
|
||||
|
||||
printf "\n\n====== wait $TIMEOUT to execute apt-mirror command ======\n\n"
|
||||
sleep $TIMEOUT
|
||||
apt-mirror
|
||||
printf "\n\n====== wait $UNIT to execute apt-mirror again ======\n\n"
|
||||
sleep $UNIT
|
||||
|
||||
done
|
||||
|
|
|
|||
Loading…
Reference in New Issue