Update setup.sh

This commit is contained in:
kongkrit 2020-01-03 02:07:56 +07:00 committed by GitHub
parent bdc1bb9b89
commit 80b0924af7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 12 additions and 3 deletions

View File

@ -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