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
logo
# Check for sudo access
if [[ $(id -u) = 0 ]]; then
echo "Please run as normal user"
exit
fi
sudoFunc () {
echo "Please put in password for sudo"
# Must be running as sudo
if [[ $(id -u) != 0 ]]; then
if [[ $(sudo id -u) != 0 ]]; then
echo "Sudo authentication failed. Please try again"
exit
fi
}
# Prompt for elevated prompt for scripts