Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Support more shared directories #987

Merged
merged 3 commits into from
Jan 8, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Prevent shared directory names from being duplicated
Prevent directory duplication and add index mechanism
  • Loading branch information
ncheng89 authored Dec 26, 2024
commit c3f5af376184bf5e5e51adfa04e7ff1213bcdd87
4 changes: 3 additions & 1 deletion src/samba.sh
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,12 @@ addShare "$share" "Data" "Shared" || error "Failed to create shared folder!"

IFS=',' read -r -a dirs <<< "${SHARED_DIRS:-}"
# Traverse the directory and create shares
index_dir=1
for dir in "${dirs[@]}"; do
if [ -d "$dir" ]; then
dir_name=$(basename "$dir")
addShare "$dir" "$dir_name" "Shared $dir_name" || error "Failed to create shared folder for $dir!"
addShare "$dir" "${dir_name}_${index_dir}" "Shared $dir_name" || error "Failed to create shared folder for $dir!"
((index_dir++))
fi
done

Expand Down
Loading