have improved sudo check
This commit is contained in:
2024-11-08 20:38:42 +10:00
parent 68b807c563
commit 523ec87db5

View File

@@ -2,20 +2,19 @@
# Debian XFCE init and setup # Debian XFCE init and setup
logo
# Check for sudo access # Check for sudo access
if [[ $(id -u) = 0 ]]; then if [[ $(id -u) = 0 ]]; then
echo "Please run as normal user" echo "Please run as normal user"
exit exit
fi fi
sudoFunc () { echo "Please put in password for sudo"
# Must be running as sudo # Must be running as sudo
if [[ $(id -u) != 0 ]]; then if [[ $(sudo id -u) != 0 ]]; then
echo "Sudo authentication failed. Please try again" echo "Sudo authentication failed. Please try again"
exit exit
fi fi
}
# Prompt for elevated prompt for scripts # Prompt for elevated prompt for scripts