1
0
mirror of https://github.com/pi-hole/pi-hole synced 2024-12-22 14:58:08 +00:00

Merge pull request #3827 from hvnsweeting/development

Re-run the script as root instead of piping to bash
This commit is contained in:
Adam Warner 2020-11-15 20:39:25 +00:00 committed by GitHub
commit be03f29a9e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2623,8 +2623,16 @@ main() {
# If the sudo command exists,
if is_command sudo ; then
printf "%b %b Sudo utility check\\n" "${OVER}" "${TICK}"
# Download the install script and run it with admin rights
exec curl -sSL https://raw.githubusercontent.com/pi-hole/pi-hole/master/automated%20install/basic-install.sh | sudo bash "$@"
# when run via curl piping
if [[ "$0" == "bash" ]]; then
# Download the install script and run it with admin rights
exec curl -sSL https://raw.githubusercontent.com/pi-hole/pi-hole/master/automated%20install/basic-install.sh | sudo bash "$@"
else
# when run via calling local bash script
exec sudo bash "$0" "$@"
fi
exit $?
# Otherwise,
else