sudo detection doesnt work

This commit is contained in:
Thomas Forgione 2019-04-22 10:03:25 +02:00
parent 911ed44e39
commit 68ba5323de
No known key found for this signature in database
GPG Key ID: BFD17A2D71B3B5E7
1 changed files with 4 additions and 12 deletions

View File

@ -67,18 +67,10 @@ _check_date() {
update-system() {
# Ask for sudo right now
sudoresult=$(sudo -n -l true 2>&1)
if [ $? -eq 0 ]; then
echo "\033[32;1m=== Starting system update, please enter your password ===\033[0m"
sudo true
if [ $? -ne 0 ]; then
echo "Could not get sudo..."
return 1
fi
else
echo "\033[33;1m=== You are not a sudoer, skipping system update... ===\033[0m"
echo "\033[32;1m=== Starting system update, please enter your password ===\033[0m"
sudo true
if [ $? -ne 0 ]; then
echo "Could not get sudo..."
return 1
fi