diff --git a/script-files-permissions-set b/script-files-permissions-set index b672e480..3df9b7ce 100755 --- a/script-files-permissions-set +++ b/script-files-permissions-set @@ -7,8 +7,8 @@ is_root if [[ $# -eq 0 ]]; then - user=$(stat -c "%U" "$path") - group=$(stat -c "%G" "$path") + user=$(stat -c "%U" "$PWD") + group=$(stat -c "%G" "$PWD") echo "No arguments provided, using autodetection" if [[ "$group" != "smbgrp" ]]; then echo "This file will not be world-accessible by the smbgrp group" diff --git a/script-user-add b/script-user-add index 08272639..27407e3d 100755 --- a/script-user-add +++ b/script-user-add @@ -34,9 +34,6 @@ ask_ok "Make user $username an admin?" && \ useradd_cmd+=("-G" "$group_str") useradd_cmd+=("$username") -echo "Command: ${useradd_cmd[*]}" -"${useradd_cmd[@]}" -echo "$username":"$password" | chpasswd if [[ "$restore" == "yes" ]]; then if rsync -av --progress=info2 /mnt/array/home-retired/"$username" /home/"$username"; then @@ -45,6 +42,10 @@ if [[ "$restore" == "yes" ]]; then fi fi +echo "Command: ${useradd_cmd[*]}" +"${useradd_cmd[@]}" +echo "$username":"$password" | chpasswd + if [[ "$samba" == "yes" ]]; then (echo "$password"; echo "$password") | smbpasswd -a -s "$username" fi