feat: Support more shared directories (#987)
Some checks failed
Build / Test (push) Has been cancelled
Build / Build (push) Has been cancelled

* 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:
ncheng89 2025-01-08 22:55:17 +08:00 committed by GitHub
parent 28f6e9c76b
commit d9c7983bb5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -92,6 +92,13 @@ 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 <<< "${SHARES:-}"
for dir in "${dirs[@]}"; do
[ ! -d "$dir" ] && continue
dir_name=$(basename "$dir")
addShare "$dir" "$dir_name" "Shared $dir_name" || error "Failed to create shared folder for $dir!"
done
if ! smbd; then
error "Samba daemon failed to start!"
smbd -i --debug-stdout || true