Compare commits

...

2 Commits

Author SHA1 Message Date
ncheng89
d9c7983bb5
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
2025-01-08 15:55:17 +01:00
James Nguyen
28f6e9c76b
feat: Allow symlinks in shared folder (#1001) 2025-01-08 15:38:51 +01:00

View File

@ -71,6 +71,9 @@ addShare() {
echo " guest account = nobody" echo " guest account = nobody"
echo " map to guest = Bad User" echo " map to guest = Bad User"
echo " server min protocol = NT1" echo " server min protocol = NT1"
echo " follow symlinks = yes"
echo " wide links = yes"
echo " unix extensions = no"
echo "" echo ""
echo " # disable printing services" echo " # disable printing services"
echo " load printers = no" echo " load printers = no"
@ -89,6 +92,13 @@ addShare "$share" "Data" "Shared" || error "Failed to create shared folder!"
[ -d "/data2" ] && addShare "/data2" "Data2" "Shared" [ -d "/data2" ] && addShare "/data2" "Data2" "Shared"
[ -d "/data3" ] && addShare "/data3" "Data3" "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 if ! smbd; then
error "Samba daemon failed to start!" error "Samba daemon failed to start!"
smbd -i --debug-stdout || true smbd -i --debug-stdout || true