mirror of
https://github.com/pi-hole/pi-hole.git
synced 2024-11-15 10:43:55 +00:00
Merge pull request #738 from pi-hole/updateFix
Add check at the beginning of update script to check for existence of…
This commit is contained in:
commit
3bc7172e5e
1 changed files with 12 additions and 0 deletions
12
pihole
12
pihole
|
@ -49,6 +49,18 @@ function flushFunc {
|
||||||
|
|
||||||
|
|
||||||
function updatePiholeFunc {
|
function updatePiholeFunc {
|
||||||
|
|
||||||
|
if [ ! -d "/etc/.pihole" ]; then #This is unlikely
|
||||||
|
echo "::: Critical Error: Pi-Hole repo missing from system!"
|
||||||
|
echo "::: Please re-run install script from https://github.com/pi-hole/pi-hole"
|
||||||
|
exit 1;
|
||||||
|
fi
|
||||||
|
if [ ! -d "/var/www/html/admin" ]; then #This is unlikely
|
||||||
|
echo "::: Critical Error: Pi-Hole repo missing from system!"
|
||||||
|
echo "::: Please re-run install script from https://github.com/pi-hole/pi-hole"
|
||||||
|
exit 1;
|
||||||
|
fi
|
||||||
|
|
||||||
echo "::: Checking for updates..."
|
echo "::: Checking for updates..."
|
||||||
piholeVersion=$(cd /etc/.pihole/ && git describe --tags --abbrev=0)
|
piholeVersion=$(cd /etc/.pihole/ && git describe --tags --abbrev=0)
|
||||||
piholeVersionLatest=$(curl -s https://api.github.com/repos/pi-hole/pi-hole/releases/latest | grep -Po '"tag_name":.*?[^\\]",' | perl -pe 's/"tag_name": "//; s/^"//; s/",$//')
|
piholeVersionLatest=$(curl -s https://api.github.com/repos/pi-hole/pi-hole/releases/latest | grep -Po '"tag_name":.*?[^\\]",' | perl -pe 's/"tag_name": "//; s/^"//; s/",$//')
|
||||||
|
|
Loading…
Reference in a new issue