From 512204875cd2f9b4ae02706d2db0620fb3516a18 Mon Sep 17 00:00:00 2001 From: Storm Dragon Date: Sat, 19 Aug 2023 16:57:34 -0400 Subject: [PATCH] Update to audible prompt without breaking configure for those that do not have the audibleprompt.sh code. --- configure-stormux.sh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/configure-stormux.sh b/configure-stormux.sh index a498363..869a1d8 100755 --- a/configure-stormux.sh +++ b/configure-stormux.sh @@ -23,8 +23,10 @@ # For audible sudo prompts: +unset sudoFlags if [[ -x /etc/audibleprompt.sh ]]; then export SUDO_ASKPASS=/etc/audibleprompt.sh + export sudoFlags=("-A") fi # Include functions common to all operations @@ -49,7 +51,7 @@ diskSize="$(df -h --output='size' / | tail -1 | tr -cd '[:digit:].')" diskSize=${diskSize%.*} if [[ $diskSize -le 5 ]]; then if [[ "$(yesno "$diskSource is only $diskSize gigs, which means it probably needs to be resized. Would you like to do this now?")" == "Yes" ]]; then - sudo growpartfs $diskSource + sudo "${sudoFlags[@]} growpartfs $diskSource fi fi @@ -63,8 +65,8 @@ while [[ "$choice" != "Exit" ]]; do /usr/bin/nmtui-connect ;; "Enable Bluetooth") - sudo sed -i 's/^#AutoEnable=false$/AutoEnable=true/' /etc/bluetooth/main.conf - sudo systemctl enable bluetooth --now + sudo "${sudoFlags[@]}" sed -i 's/^#AutoEnable=false$/AutoEnable=true/' /etc/bluetooth/main.conf + sudo "${sudoFlags[@]}" systemctl enable bluetooth --now ;; "Install Lxqt Desktop") source .includes/gui.sh lxqt @@ -88,7 +90,7 @@ while [[ "$choice" != "Exit" ]]; do source .includes/irc.sh ;; "Update configure-stormux") - sudo git pull + sudo "${sudoFlags[@]}" git pull exit $? ;; esac