mirror of
https://github.com/pi-hole/pi-hole.git
synced 2024-11-15 02:42:58 +00:00
Merge branch 'feature/defensiveTweaks' of https://github.com/pi-hole/pi-hole into feature/defensiveTweaks
This commit is contained in:
commit
9c83825cb8
2 changed files with 20 additions and 18 deletions
|
@ -14,7 +14,7 @@ Works on most Debian and CentOS/RHEL based distributions!
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
wget -O basic-install.sh https://install.pi-hole.net
|
wget -O basic-install.sh https://install.pi-hole.net
|
||||||
cat basic-install.sh | bash
|
bash basic-install.sh
|
||||||
```
|
```
|
||||||
If you wish to read over the script before running it, then after the [`wget`](https://linux.die.net/man/1/wget) command, run `nano basic-install.sh` to open the file in a text viewer.
|
If you wish to read over the script before running it, then after the [`wget`](https://linux.die.net/man/1/wget) command, run `nano basic-install.sh` to open the file in a text viewer.
|
||||||
|
|
||||||
|
|
|
@ -21,15 +21,17 @@ readonly PI_HOLE_FILES_DIR="/etc/.pihole"
|
||||||
|
|
||||||
is_repo() {
|
is_repo() {
|
||||||
# Use git to check if directory is currently under VCS
|
# Use git to check if directory is currently under VCS
|
||||||
echo -n "::: Checking $1 is a repo..."
|
local directory="${1}"
|
||||||
cd "${1}" &> /dev/null || return 1
|
local gitRepo=0
|
||||||
if [[ $(git status --short) ]]; then
|
echo -n "::: Checking if ${directory} is a repo... "
|
||||||
echo " OK!"
|
cd "${directory}" &> /dev/null || return 1
|
||||||
return 0
|
if [[ $(git status --short > /dev/null) ]]; then
|
||||||
else
|
echo "OK"
|
||||||
echo " not found!"
|
else
|
||||||
return 1
|
echo "not found!"
|
||||||
fi
|
gitRepo=1
|
||||||
|
fi;
|
||||||
|
return ${gitRepo}
|
||||||
}
|
}
|
||||||
|
|
||||||
make_repo() {
|
make_repo() {
|
||||||
|
@ -74,14 +76,14 @@ fi
|
||||||
|
|
||||||
echo "::: Checking for updates..."
|
echo "::: Checking for updates..."
|
||||||
# Checks Pi-hole version > pihole only > current local git repo version : returns string in format vX.X.X
|
# Checks Pi-hole version > pihole only > current local git repo version : returns string in format vX.X.X
|
||||||
piholeVersion=$(/usr/local/bin/pihole -v -p -c)
|
piholeVersion="$(/usr/local/bin/pihole -v -p -c)"
|
||||||
# Checks Pi-hole version > pihole only > remote upstream repo version : returns string in format vX.X.X
|
# Checks Pi-hole version > pihole only > remote upstream repo version : returns string in format vX.X.X
|
||||||
piholeVersionLatest=$(/usr/local/bin/pihole -v -p -l)
|
piholeVersionLatest="$(/usr/local/bin/pihole -v -p -l)"
|
||||||
|
|
||||||
# Checks Pi-hole version > admin only > current local git repo version : returns string in format vX.X.X
|
# Checks Pi-hole version > admin only > current local git repo version : returns string in format vX.X.X
|
||||||
webVersion=$(/usr/local/bin/pihole -v -a -c)
|
webVersion="$(/usr/local/bin/pihole -v -a -c)"
|
||||||
# Checks Pi-hole version > admin only > remote upstream repo version : returns string in format vX.X.X
|
# Checks Pi-hole version > admin only > remote upstream repo version : returns string in format vX.X.X
|
||||||
webVersionLatest=$(/usr/local/bin/pihole -v -a -l)
|
webVersionLatest="$(/usr/local/bin/pihole -v -a -l)"
|
||||||
|
|
||||||
echo ":::"
|
echo ":::"
|
||||||
echo "::: Pi-hole version is $piholeVersion (Latest version is $piholeVersionLatest)"
|
echo "::: Pi-hole version is $piholeVersion (Latest version is $piholeVersionLatest)"
|
||||||
|
@ -111,7 +113,7 @@ elif [[ "${piholeVersion}" == "${piholeVersionLatest}" ]] && [[ "${webVersion}"
|
||||||
echo "::: Pi-hole Web Admin files out of date"
|
echo "::: Pi-hole Web Admin files out of date"
|
||||||
getGitFiles "${ADMIN_INTERFACE_DIR}" "${ADMIN_INTERFACE_GIT_URL}"
|
getGitFiles "${ADMIN_INTERFACE_DIR}" "${ADMIN_INTERFACE_GIT_URL}"
|
||||||
echo ":::"
|
echo ":::"
|
||||||
webVersion=$(/usr/local/bin/pihole -v -a -c)
|
webVersion="$(/usr/local/bin/pihole -v -a -c)"
|
||||||
echo "::: Web Admin version is now at ${webVersion}"
|
echo "::: Web Admin version is now at ${webVersion}"
|
||||||
echo "::: If you had made any changes in '/var/www/html/admin', they have been stashed using 'git stash'"
|
echo "::: If you had made any changes in '/var/www/html/admin', they have been stashed using 'git stash'"
|
||||||
echo ""
|
echo ""
|
||||||
|
@ -122,7 +124,7 @@ elif [[ "${piholeVersion}" != "${piholeVersionLatest}" ]] && [[ "${webVersion}"
|
||||||
/etc/.pihole/automated\ install/basic-install.sh --reconfigure --unattended || echo "Unable to complete update, contact Pi-hole" && exit 1
|
/etc/.pihole/automated\ install/basic-install.sh --reconfigure --unattended || echo "Unable to complete update, contact Pi-hole" && exit 1
|
||||||
|
|
||||||
echo ":::"
|
echo ":::"
|
||||||
piholeVersion=$(/usr/local/bin/pihole -v -p -c)
|
piholeVersion="$(/usr/local/bin/pihole -v -p -c)"
|
||||||
echo "::: Pi-hole version is now at ${piholeVersion}"
|
echo "::: Pi-hole version is now at ${piholeVersion}"
|
||||||
echo "::: If you had made any changes in '/etc/.pihole', they have been stashed using 'git stash'"
|
echo "::: If you had made any changes in '/etc/.pihole', they have been stashed using 'git stash'"
|
||||||
echo ""
|
echo ""
|
||||||
|
@ -133,9 +135,9 @@ elif [[ "${piholeVersion}" != "${piholeVersionLatest}" ]] && [[ "${webVersion}"
|
||||||
/etc/.pihole/automated\ install/basic-install.sh --unattended || echo "Unable to complete update, contact Pi-hole" && exit 1
|
/etc/.pihole/automated\ install/basic-install.sh --unattended || echo "Unable to complete update, contact Pi-hole" && exit 1
|
||||||
|
|
||||||
# Checks Pi-hole version > admin only > current local git repo version : returns string in format vX.X.X
|
# Checks Pi-hole version > admin only > current local git repo version : returns string in format vX.X.X
|
||||||
webVersion=$(/usr/local/bin/pihole -v -a -c)
|
webVersion="$(/usr/local/bin/pihole -v -a -c)"
|
||||||
# Checks Pi-hole version > admin only > current local git repo version : returns string in format vX.X.X
|
# Checks Pi-hole version > admin only > current local git repo version : returns string in format vX.X.X
|
||||||
piholeVersion=$(/usr/local/bin/pihole -v -p -c)
|
piholeVersion="$(/usr/local/bin/pihole -v -p -c)"
|
||||||
echo ":::"
|
echo ":::"
|
||||||
echo "::: Pi-hole version is now at ${piholeVersion}"
|
echo "::: Pi-hole version is now at ${piholeVersion}"
|
||||||
echo "::: If you had made any changes in '/etc/.pihole', they have been stashed using 'git stash'"
|
echo "::: If you had made any changes in '/etc/.pihole', they have been stashed using 'git stash'"
|
||||||
|
|
Loading…
Reference in a new issue