don't output "elevating with sudo" in pihole script, just do it.

This commit is contained in:
Adam Warner 2016-10-18 12:05:48 +01:00
parent 97a013b2b7
commit 29ad2496b6
3 changed files with 73 additions and 8 deletions

View file

@ -10,6 +10,10 @@
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
normalOutput(){
piholeVersion=$(cd /etc/.pihole/ && git describe --tags --abbrev=0)
webVersion=$(cd /var/www/html/admin/ && git describe --tags --abbrev=0)
@ -17,4 +21,15 @@ piholeVersionLatest=$(curl -s https://api.github.com/repos/pi-hole/pi-hole/relea
webVersionLatest=$(curl -s https://api.github.com/repos/pi-hole/AdminLTE/releases/latest | grep -Po '"tag_name":.*?[^\\]",' | perl -pe 's/"tag_name": "//; s/^"//; s/",$//')
echo "::: Pi-hole version is $piholeVersion (Latest version is $piholeVersionLatest)"
echo "::: Web-Admin version is $webVersion (Latest version is $webVersionLatest)"
echo "::: Web-Admin version is $webVersion (Latest version is $webVersionLatest)"
}
for var in "$@"
do
case "$var" in
"-j" | "--json" ) outputJSON;;
"-h" | "--help" ) displayHelp;;
* ) normalOutput;;
esac
done