diff --git a/script-user-add b/script-user-add index fffc081a..001eba65 100755 --- a/script-user-add +++ b/script-user-add @@ -28,16 +28,19 @@ 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?" && \