This was the most stupid bug in the world, fixed in the smartest way ever
This commit is contained in:
4
harden
4
harden
@@ -719,7 +719,7 @@ function main {
|
|||||||
automaticUpdatesCronjob || exit 1 # Install a cronjob to update the system periodically
|
automaticUpdatesCronjob || exit 1 # Install a cronjob to update the system periodically
|
||||||
printf "%s\n" "CronJob to update the system installed"
|
printf "%s\n" "CronJob to update the system installed"
|
||||||
# If the username is not secdep, delete the remaining users
|
# 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" "Any unnecessary users deleted"
|
||||||
printf "%s\n" "$SCRIPT_NAME script finished" # Output message to the user
|
printf "%s\n" "$SCRIPT_NAME script finished" # Output message to the user
|
||||||
printf "%s\n" "System will reboot momentarily" # 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
|
# 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
|
# 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.
|
# want to see the exit code.
|
||||||
if [[ "$USERNAME" != "secdep" ]]; then
|
if [[ "$USER" != "secdep" ]]; then
|
||||||
sudo shutdown -r +3
|
sudo shutdown -r +3
|
||||||
else
|
else
|
||||||
sudo shutdown -r +1
|
sudo shutdown -r +1
|
||||||
|
|||||||
Reference in New Issue
Block a user