mirror of
https://github.com/pi-hole/pi-hole.git
synced 2024-11-29 01:23:18 +00:00
rename to updatePihole.sh
This commit is contained in:
parent
4b1633eac4
commit
aac7fa9c14
1 changed files with 31 additions and 0 deletions
31
advanced/Scripts/updatePihole.sh
Normal file
31
advanced/Scripts/updatePihole.sh
Normal file
|
@ -0,0 +1,31 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
# Pi-hole: A black hole for Internet advertisements
|
||||||
|
# (c) 2015, 2016 by Jacob Salmela
|
||||||
|
# Network-wide ad blocking via your Raspberry Pi
|
||||||
|
# http://pi-hole.net
|
||||||
|
# Checks if Pi-hole needs updating and then
|
||||||
|
#
|
||||||
|
# Pi-hole is free software: you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation, either version 2 of the License, or
|
||||||
|
# (at your option) any later version.
|
||||||
|
|
||||||
|
# Taken from http://stackoverflow.com/questions/3258243/check-if-pull-needed-in-git
|
||||||
|
|
||||||
|
# Move into the git directory
|
||||||
|
cd /etc/.pihole/
|
||||||
|
|
||||||
|
LOCAL=$(git rev-parse @)
|
||||||
|
REMOTE=$(git rev-parse @{u})
|
||||||
|
BASE=$(git merge-base @ @{u})
|
||||||
|
|
||||||
|
if [[ $LOCAL = $REMOTE ]]; then
|
||||||
|
echo "Up-to-date"
|
||||||
|
elif [[ $LOCAL = $BASE ]]; then
|
||||||
|
echo "Updating Pi-hole..."
|
||||||
|
git pull
|
||||||
|
elif [[ $REMOTE = $BASE ]]; then
|
||||||
|
: # Need to push, so do nothing
|
||||||
|
else
|
||||||
|
: # Diverged, so do nothing
|
||||||
|
fi
|
Loading…
Reference in a new issue