Skip to content

Commit

Permalink
feat: Support multiple users
Browse files Browse the repository at this point in the history
  • Loading branch information
kroese authored Oct 9, 2024
1 parent 1ea0718 commit f02248f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions samba.sh
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ add_user() {
group="smb"
share="/storage"
secret="/run/secrets/pass"
users="/etc/samba/users.conf"
config="/etc/samba/smb.conf"
user_config="/etc/samba/smb_user.conf"

# Create shared directory
mkdir -p "$share" || { echo "Failed to create directory $share"; exit 1; }
Expand Down Expand Up @@ -102,7 +102,7 @@ else
fi

# Check if multi-user mode is enabled
if [ -f "$user_config" ] && [ -s "$user_config" ]; then
if [ -f "$users" ] && [ -s "$users" ]; then

while read -r line; do

Expand All @@ -125,7 +125,7 @@ if [ -f "$user_config" ] && [ -s "$user_config" ]; then
# Call the function with extracted values
add_user "$config" "$username" "$uid" "$groupname" "$gid" "$password"

done < "$user_config"
done < "$users"

else

Expand Down

0 comments on commit f02248f

Please sign in to comment.