diff --git a/modify-sudoers.sh b/modify-sudoers.sh index 9a6fdab..2468186 100644 --- a/modify-sudoers.sh +++ b/modify-sudoers.sh @@ -13,7 +13,7 @@ ROOT_LINE_NUM=$(grep -n "^root" /etc/sudoers | cut -d : -f 1) # Check if the root user is already configured to execute commands as other users if sudo sed -n "${ROOT_LINE_NUM}p" /etc/sudoers | grep -q "ALL=(ALL:ALL)" ; then echo "Root user is already configured to execute commands as other users." - return 0 + exit 0 fi echo "Attempting to safely modify /etc/sudoers..." @@ -33,4 +33,4 @@ if [ $? -eq 0 ]; then else echo "Error while trying to modify /etc/sudoers, please edit manually." exit 1 -fi \ No newline at end of file +fi