From f8896a5dead3ee4bc0805ab93c7118b3c2e1d2ca Mon Sep 17 00:00:00 2001 From: Terry Chen Date: Fri, 14 Aug 2015 10:02:56 +0800 Subject: [PATCH] add default sleep value and update README.md --- README.md | 13 ++++++------- setup.sh | 6 ++++-- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 71a1b5c..e52d051 100644 --- a/README.md +++ b/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. diff --git a/setup.sh b/setup.sh index 5e80022..8466007 100755 --- a/setup.sh +++ b/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