From 91eebdc8ff593fed48912ba2a190f3a550cb45d9 Mon Sep 17 00:00:00 2001 From: itsmesid Date: Thu, 26 Sep 2019 07:31:17 +0530 Subject: [PATCH 1/2] Update file --- update.sh | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 update.sh diff --git a/update.sh b/update.sh new file mode 100644 index 0000000..9ff08d2 --- /dev/null +++ b/update.sh @@ -0,0 +1,31 @@ +#!/bin/bash + +echo "Updating Pihole and Speedtest-mod" + +#Revert admin to Pihole's newest +cd /var/www/html +sudo rm -rf admin/ +sudo git clone https://github.com/pi-hole/AdminLTE admin + +#Rever pihole's webpage +cd /opt/pihole/ +sudo rm webpage.sh +sudo wget https://github.com/pi-hole/pi-hole/raw/master/advanced/Scripts/webpage.sh +sudo chmod +x webpage.sh + +#Update Pihole +pihole -up + +#Update lastest speedtest-mod +cd /var/www/html +sudo mv admin admin_org +sudo git clone https://github.com/TooManyEggrolls/AdminLTE admin + +#Update latest webpage.sh for speedtest-mod +cd /opt/pihole/ +sudo mv webpage.sh webpage.sh.org +sudo wget https://github.com/TooManyEggrolls/pi-hole/raw/master/advanced/Scripts/webpage.sh +sudo chmod +x webpage.sh + +#Update version info +pihole updatechecker local From 21b4bd7bcac8eee122af9f6ed36176983251da1e Mon Sep 17 00:00:00 2001 From: itsmesid Date: Sat, 28 Sep 2019 00:55:34 +0530 Subject: [PATCH 2/2] Added prompts Added prompts --- update.sh | 31 +++++++++++++++++++++---------- 1 file changed, 21 insertions(+), 10 deletions(-) diff --git a/update.sh b/update.sh index 9ff08d2..df99b39 100644 --- a/update.sh +++ b/update.sh @@ -1,31 +1,42 @@ #!/bin/bash +if [[ $EUID -ne 0 ]]; then + echo "This script must be run as root" + exit 1 +fi + +whiptail --title "Pihole Speedtest Mod " --msgbox "Pihole Speedtest Mod Updater. \nSupport : https://github.com/arevindh/pihole-speedtest " 8 78 + echo "Updating Pihole and Speedtest-mod" #Revert admin to Pihole's newest cd /var/www/html -sudo rm -rf admin/ -sudo git clone https://github.com/pi-hole/AdminLTE admin +rm -rf admin/ +git clone https://github.com/pi-hole/AdminLTE admin #Rever pihole's webpage cd /opt/pihole/ -sudo rm webpage.sh -sudo wget https://github.com/pi-hole/pi-hole/raw/master/advanced/Scripts/webpage.sh -sudo chmod +x webpage.sh +rm webpage.sh +wget https://github.com/pi-hole/pi-hole/raw/master/advanced/Scripts/webpage.sh +chmod +x webpage.sh + #Update Pihole pihole -up #Update lastest speedtest-mod cd /var/www/html -sudo mv admin admin_org -sudo git clone https://github.com/TooManyEggrolls/AdminLTE admin +mv admin admin_org +git clone https://github.com/TooManyEggrolls/AdminLTE admin #Update latest webpage.sh for speedtest-mod cd /opt/pihole/ -sudo mv webpage.sh webpage.sh.org -sudo wget https://github.com/TooManyEggrolls/pi-hole/raw/master/advanced/Scripts/webpage.sh -sudo chmod +x webpage.sh +mv webpage.sh webpage.sh.org +wget https://github.com/TooManyEggrolls/pi-hole/raw/master/advanced/Scripts/webpage.sh +chmod +x webpage.sh #Update version info pihole updatechecker local + + +whiptail --title "Pihole Speedtest Mod" --msgbox "Update complete" 8 78