File tree 1 file changed +2
-2
lines changed 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -48,11 +48,11 @@ add_user() {
48
48
# Check if the user is a samba user
49
49
if pdbedit -s " $cfg " -L | grep -q " ^$username :" ; then
50
50
# if the user is a samba user, change its password
51
- echo -e " $password \n$password " | smbpasswd -s " $username " || { echo " Failed to update Samba password for $username " ; return 1; }
51
+ echo -e " $password \n$password " | smbpasswd -c " $cfg " - s " $username " || { echo " Failed to update Samba password for $username " ; return 1; }
52
52
[[ " $username " != " samba" ]] && echo " Password for existing Samba user $username has been updated."
53
53
else
54
54
# if the user is not a samba user, create it and set a password
55
- echo -e " $password \n$password " | smbpasswd -a -s " $username " || { echo " Failed to add Samba user $username " ; return 1; }
55
+ echo -e " $password \n$password " | smbpasswd -a -c " $cfg " - s " $username " || { echo " Failed to add Samba user $username " ; return 1; }
56
56
[[ " $username " != " samba" ]] && echo " User $username has been added to Samba and password set."
57
57
fi
58
58
}
You can’t perform that action at this time.
0 commit comments