2016-05-25 04:55:36 +02:00
#!/bin/bash -x
2016-02-24 14:27:50 +01:00
2016-05-11 17:41:06 +02:00
# Grab newest code and update version files
2016-06-16 06:27:16 +02:00
git submodule foreach git pull;
2016-03-30 02:51:08 +02:00
git submodule foreach git pull origin master;
pushd pi-hole ; git describe --tags --abbrev= 0 > ../pi-hole_version.txt ; popd ;
pushd AdminLTE ; git describe --tags --abbrev= 0 > ../AdminLTE_version.txt ; popd ;
2016-05-11 17:41:06 +02:00
# Copy latest crontab and modify to use docker exec commands
cron = './docker-pi-hole.cron'
cp -f pi-hole/advanced/pihole.cron ${ cron } ;
2016-05-25 04:55:36 +02:00
sed -i '/Update the ad sources/ i\# Your container name goes here:\nDOCKER_NAME=pihole\nPATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin\n' ${ cron } ;
2017-01-08 17:42:39 +01:00
sed -i "s|pihole |docker exec \$DOCKER_NAME pihole |g" ${ cron } ;
2016-05-25 04:55:36 +02:00
sed -i '/docker exec/ s|$| > /dev/null|g' ${ cron } ;
2016-10-07 19:38:44 +02:00
2016-05-11 17:41:06 +02:00
# docker-pi-hole users update their docker images, not git code
2016-10-07 19:38:44 +02:00
sed -i '/Update Pi-hole/ a\# pihole software update commands are unsupported in docker!' ${ cron } ;
sed -i '/Update Pi-hole/ c\# Update docker-pi-hole by pulling the latest docker image ane re-creating your container.' ${ cron } ;
2016-05-11 17:41:06 +02:00
sed -i '/pihole updateDashboard/ s/^/#/' ${ cron } ;