Make user functions more robust
This commit is contained in:
@@ -26,15 +26,15 @@ fi
|
||||
ask_ok "Create user $username with password $password?" || exit $?
|
||||
|
||||
restore="no"
|
||||
if [[ -d /mnt/array/home-retired/"$username" ]]; then
|
||||
if [[ -d /mnt/array/home-retired/$username ]]; then
|
||||
ask_ok "Restore user $username's files from /mnt/array/home-retired/$user?" && restore="yes"
|
||||
fi
|
||||
|
||||
samba="no"
|
||||
ask_ok "Enable shared file access for user $username?" && group_str="smbgrp," && samba="yes"
|
||||
ask_ok "Enable shared file access for user $username?" && group_str="smbgrp" && samba="yes"
|
||||
|
||||
ask_ok "Make user $username an admin?" && \
|
||||
group_str+="wheel"
|
||||
group_str+=",wheel"
|
||||
|
||||
useradd_cmd+=("-G" "$group_str")
|
||||
useradd_cmd+=("$username")
|
||||
|
||||
Reference in New Issue
Block a user