Fix script-files-permissions-set
This commit is contained in:
@@ -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"
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user