Fix script-user-remove
This commit is contained in:
@@ -29,15 +29,18 @@ fi
|
||||
ask_ok "Make user $username an admin?" && \
|
||||
group_str="wheel"
|
||||
|
||||
ask_ok "Enable shared file access for user $username?" && \
|
||||
group_str+=",smbgrp" && \
|
||||
(echo "$password"; echo "$password") | smbpasswd -a -s "$username"
|
||||
samba="no"
|
||||
ask_ok "Enable shared file access for user $username?" && group_str+=",smbgrp" && samba="yes"
|
||||
|
||||
useradd_cmd+=("-G" "$group_str")
|
||||
useradd_cmd+=("$username")
|
||||
echo "Command: ${useradd_cmd[*]}"
|
||||
"${useradd_cmd[@]}"
|
||||
|
||||
if [[ "$samba" == "yes" ]]; then
|
||||
(echo "$password"; echo "$password") | smbpasswd -a -s "$username"
|
||||
fi
|
||||
|
||||
if [[ "$restore" == "yes" ]]; then
|
||||
if rsync -av --progress=info2 /mnt/array/home-retired/"$username" /home/"$username"; then
|
||||
ask_ok "User $username's files successfully restored, remove backup at /mnt/array/home-retired/$username?" && \
|
||||
|
||||
Reference in New Issue
Block a user