mirror of
https://github.com/dockur/windows.git
synced 2025-10-27 11:25:49 +00:00
Support more shared directories
Control the sharing of more directories through environment variables instead of hard-coding more shared directories
This commit is contained in:
parent
57193b0f59
commit
eb8775bec7
1 changed files with 8 additions and 2 deletions
10
src/samba.sh
10
src/samba.sh
|
|
@ -86,8 +86,14 @@ share="/data"
|
|||
|
||||
addShare "$share" "Data" "Shared" || error "Failed to create shared folder!"
|
||||
|
||||
[ -d "/data2" ] && addShare "/data2" "Data2" "Shared"
|
||||
[ -d "/data3" ] && addShare "/data3" "Data3" "Shared"
|
||||
IFS=',' read -r -a dirs <<< "${SHARED_DIRS:-}"
|
||||
# Traverse the directory and create shares
|
||||
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!"
|
||||
fi
|
||||
done
|
||||
|
||||
if ! smbd; then
|
||||
error "Samba daemon failed to start!"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue