Fix script-files-permissions-set
This commit is contained in:
@@ -7,8 +7,8 @@
|
|||||||
is_root
|
is_root
|
||||||
|
|
||||||
if [[ $# -eq 0 ]]; then
|
if [[ $# -eq 0 ]]; then
|
||||||
user=$(stat -c "%U" "$path")
|
user=$(stat -c "%U" "$PWD")
|
||||||
group=$(stat -c "%G" "$path")
|
group=$(stat -c "%G" "$PWD")
|
||||||
echo "No arguments provided, using autodetection"
|
echo "No arguments provided, using autodetection"
|
||||||
if [[ "$group" != "smbgrp" ]]; then
|
if [[ "$group" != "smbgrp" ]]; then
|
||||||
echo "This file will not be world-accessible by the smbgrp group"
|
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+=("-G" "$group_str")
|
||||||
useradd_cmd+=("$username")
|
useradd_cmd+=("$username")
|
||||||
echo "Command: ${useradd_cmd[*]}"
|
|
||||||
"${useradd_cmd[@]}"
|
|
||||||
echo "$username":"$password" | chpasswd
|
|
||||||
|
|
||||||
if [[ "$restore" == "yes" ]]; then
|
if [[ "$restore" == "yes" ]]; then
|
||||||
if rsync -av --progress=info2 /mnt/array/home-retired/"$username" /home/"$username"; then
|
if rsync -av --progress=info2 /mnt/array/home-retired/"$username" /home/"$username"; then
|
||||||
@@ -45,6 +42,10 @@ if [[ "$restore" == "yes" ]]; then
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
echo "Command: ${useradd_cmd[*]}"
|
||||||
|
"${useradd_cmd[@]}"
|
||||||
|
echo "$username":"$password" | chpasswd
|
||||||
|
|
||||||
if [[ "$samba" == "yes" ]]; then
|
if [[ "$samba" == "yes" ]]; then
|
||||||
(echo "$password"; echo "$password") | smbpasswd -a -s "$username"
|
(echo "$password"; echo "$password") | smbpasswd -a -s "$username"
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user