mirror of
https://github.com/pi-hole/pi-hole.git
synced 2024-12-23 21:30:17 +00:00
Re-run the script as root instead of piping to bash
Signed-off-by: Viet Hung Nguyen <hvn@familug.org>
This commit is contained in:
parent
89d94ac3d1
commit
ae4e41eaaa
1 changed files with 10 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue