This was the most stupid bug in the world, fixed in the smartest way ever

This commit is contained in:
2023-09-07 04:22:14 +03:00
parent d517e94fad
commit d09897add4

4
harden
View File

@@ -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