From d09897add46badc096c2d50f88fcf9a1972637c0 Mon Sep 17 00:00:00 2001 From: konsthol Date: Thu, 7 Sep 2023 04:22:14 +0300 Subject: [PATCH] This was the most stupid bug in the world, fixed in the smartest way ever --- harden | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/harden b/harden index ecfee74..e31d5d2 100755 --- a/harden +++ b/harden @@ -719,7 +719,7 @@ function main { automaticUpdatesCronjob || exit 1 # Install a cronjob to update the system periodically printf "%s\n" "CronJob to update the system installed" # If the username is not secdep, delete the remaining users - [[ "$USERNAME" != "secdep" ]] && deleteRemainingUsers || exit 1 # Delete possible remaining users + [[ "$USER" != "secdep" ]] && deleteRemainingUsers || exit 1 # Delete possible remaining users printf "%s\n" "Any unnecessary users deleted" printf "%s\n" "$SCRIPT_NAME script finished" # Output message to the user printf "%s\n" "System will reboot momentarily" # Output message to the user @@ -729,7 +729,7 @@ function main { # It was not the original intention of the script to reboot the system but it is better to be safe than sorry # We also wait (for 1 or 3 minutes depending on the user running it) so that the script can finish as we # want to see the exit code. - if [[ "$USERNAME" != "secdep" ]]; then + if [[ "$USER" != "secdep" ]]; then sudo shutdown -r +3 else sudo shutdown -r +1