From 7f0d847d3aa144c051c3dfec0636e5b33ca19518 Mon Sep 17 00:00:00 2001 From: Bryan Roessler Date: Fri, 22 Oct 2021 15:46:59 -0400 Subject: [PATCH] Fix script-user-remove --- script-user-add | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) 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?" && \