Rename option now working.
This commit is contained in:
@ -36,12 +36,12 @@
|
||||
exit 1
|
||||
fi
|
||||
|
||||
local oldUser="$USER"
|
||||
oldUser="$USER"
|
||||
|
||||
local groups="$(groups "$oldUser")"
|
||||
groups="$(groups "$oldUser")"
|
||||
groups="${groups// /,}"
|
||||
|
||||
local newUser="$1"
|
||||
newUser="$1"
|
||||
if ! [[ "$newUser" =~ ^[a-z][-a-z0-9]*$ ]]; then
|
||||
msgbox "Username $newUser failed validation. It cannot contain spaces or some punctuation."
|
||||
exit 1
|
||||
@ -59,8 +59,3 @@ EOF
|
||||
# Files in cron.d must be 644 to work.
|
||||
sudo chmod 644 /etc/cron.d/0chuser
|
||||
|
||||
# Reboot the computer so the script can run
|
||||
local answer="$(yesno "Would you like to reboot now so the username can be changed? If no, you will need to reboot manually for the changes to be applied.")"
|
||||
if [[ "$answer" == "Yes" ]]; then
|
||||
sudo reboot
|
||||
fi
|
||||
|
Reference in New Issue
Block a user