From 80b0924af7c295a63af730bca52e0f37883c94c2 Mon Sep 17 00:00:00 2001 From: kongkrit <45794368+kongkrit@users.noreply.github.com> Date: Fri, 3 Jan 2020 02:07:56 +0700 Subject: [PATCH] Update setup.sh --- setup.sh | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/setup.sh b/setup.sh index eed8fed..f512099 100755 --- a/setup.sh +++ b/setup.sh @@ -19,15 +19,24 @@ cat /etc/apt/mirror.list echo "-------------------------------------" rm -f /var/run/apache2/apache2.pid + +echo "hacking www-data to become PUID=$PUID PGID=$PGID" +SEDEX="s/www-data:x:[0-9]+:[0-9]+:/www-data:x:${PUID}:${PGID}:/g" +echo "sed /etc/passwd with [$SEDEX]" +cat /etc/passwd | \ +sed -E $SEDEX > /tmp/passy +cp /tmp/passy /etc/passwd +rm /tmp/passy + echo "starting apache server" service apache2 start - echo "apache started..." +echo "TIMEOUT is ${TIMEOUT}" while true; do echo "[$(date)] Starting apt-mirror" apt-mirror echo "[$(date)] Completed" - echo "[$(date)] Sleeping $RESYNC_PERIOD to execute apt-mirror again ======" - sleep "$RESYNC_PERIOD" + echo "[$(date)] Sleeping $TIMEOUT to execute apt-mirror again ======" + sleep "$TIMEOUT" done