Make sure audible sudo prompts are available throughout configure-stormux and the start up process.

This commit is contained in:
Storm Dragon
2024-03-08 01:29:45 -05:00
parent 1e24598316
commit 40fd173777
2 changed files with 26 additions and 10 deletions

View File

@ -1,15 +1,25 @@
#!/usr/bin/env bash
if [[ "$(tty)" != "/dev/tty1" ]]; then
return
fi
if [[ -x /opt/configure-stormux/configure-stormux.sh ]]; then
exit 0
return
fi
if ! [[ -x /opt/configure-stormux/configure-stormux.sh ]]; then
exit 0
if ! [[ -x /usr/local/bin/configure-stormux ]]; then
return
fi
if [[ "$(tty)" = "/dev/tty1" ]]; then
cat << "EOF"
# For audible sudo prompts:
unset sudoFlags
if [[ -x /etc/audibleprompt.sh ]]; then
export SUDO_ASKPASS=/etc/audibleprompt.sh
export sudoFlags=("-A")
fi
cat << "EOF"
Hello, and welcome to Stormux!
Let's get you set up. After you press enter, you will be prompted for the sudo password.
@ -20,6 +30,5 @@ Once again, the password is stormux in all lower case letters.
Please press enter to continue.
EOF
read -r
sudo configure-stormux
fi
read -r
sudo "${sudoFlags[@]}" configure-stormux