diff --git a/local/provision.sh b/local/provision.sh index 825b8e3d..9a20c90b 100644 --- a/local/provision.sh +++ b/local/provision.sh @@ -338,6 +338,7 @@ setupPasswordlessSudo() { if [ -n "$SUDO_PASSWORD" ]; then logg info 'Using the acquired sudo password to automatically grant the user passwordless sudo privileges for the duration of the script' printf '%s\n' "$SUDO_PASSWORD" | sudo -p "" -S echo "$(whoami) ALL=(ALL:ALL) NOPASSWD: ALL # TEMPORARY FOR INSTALL DOCTOR" | sudo tee -a /etc/sudoers > /dev/null + echo "" else logg info 'Press CTRL+C to bypass this prompt to either enter your password when needed or perform a non-privileged installation' logg info 'Note: Non-privileged installations are not yet supported' diff --git a/scripts/provision.sh b/scripts/provision.sh index 4a0b9d25..6b53d4f4 100644 --- a/scripts/provision.sh +++ b/scripts/provision.sh @@ -355,6 +355,7 @@ setupPasswordlessSudo() { if [ -n "$SUDO_PASSWORD" ]; then logg info 'Using the acquired sudo password to automatically grant the user passwordless sudo privileges for the duration of the script' echo "$SUDO_PASSWORD" | sudo -S sh -c "echo '$(whoami) ALL=(ALL:ALL) NOPASSWD: ALL # TEMPORARY FOR INSTALL DOCTOR' | sudo -S tee -a /etc/sudoers > /dev/null" + echo "" # Old method below does not work on macOS due to multiple sudo prompts # printf '%s\n%s\n' "$SUDO_PASSWORD" | sudo -S echo "$(whoami) ALL=(ALL:ALL) NOPASSWD: ALL # TEMPORARY FOR INSTALL DOCTOR" | sudo -S tee -a /etc/sudoers > /dev/null else diff --git a/scripts/src/provision.sh.tmpl b/scripts/src/provision.sh.tmpl index 313035ce..7157fee1 100644 --- a/scripts/src/provision.sh.tmpl +++ b/scripts/src/provision.sh.tmpl @@ -118,6 +118,7 @@ setupPasswordlessSudo() { if [ -n "$SUDO_PASSWORD" ]; then logg info 'Using the acquired sudo password to automatically grant the user passwordless sudo privileges for the duration of the script' echo "$SUDO_PASSWORD" | sudo -S sh -c "echo '$(whoami) ALL=(ALL:ALL) NOPASSWD: ALL # TEMPORARY FOR INSTALL DOCTOR' | sudo -S tee -a /etc/sudoers > /dev/null" + echo "" # Old method below does not work on macOS due to multiple sudo prompts # printf '%s\n%s\n' "$SUDO_PASSWORD" | sudo -S echo "$(whoami) ALL=(ALL:ALL) NOPASSWD: ALL # TEMPORARY FOR INSTALL DOCTOR" | sudo -S tee -a /etc/sudoers > /dev/null else