attempt to self-elevate to root user to execute script

This commit is contained in:
Josh Kastang 2016-01-10 16:48:48 +00:00
parent 362fe627c6
commit a6edbf091d
2 changed files with 7 additions and 6 deletions

View file

@ -17,9 +17,9 @@
# curl -L install.pi-hole.net | bash
# Must be root to install
if [[ $EUID -ne 0 ]]; then
echo "ERROR: You must run this script as a root user"
exit 1
if [[ $EUID -ne 0 ]]; then
sudo bash "$0" "$@"
exit $?
fi
######## VARIABLES #########

View file

@ -9,11 +9,12 @@
# (at your option) any later version.
# Must be root to uninstall
if [[ $EUID -ne 0 ]]; then
echo "ERROR: You must run this script as a root user"
exit 1
if [[ $EUID -ne 0 ]]; then
sudo bash "$0" "$@"
exit $?
fi
######### SCRIPT ###########
apt-get -y remove --purge dnsutils bc toilet
apt-get -y remove --purge dnsmasq