From 759b9fb90150c7b3bbd1d851e22eb77e90c3fb83 Mon Sep 17 00:00:00 2001 From: ACKS <123@qq.com> Date: Sat, 21 Jan 2023 14:13:46 +0800 Subject: [PATCH] fix docker restart config data will append multiple times fix share without user add config security = share --- entrypoint.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/entrypoint.sh b/entrypoint.sh index 06a400e..612acb0 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -4,6 +4,7 @@ CONFIG_FILE="/etc/samba/smb.conf" hostname=`hostname` set -e +rm -rf $CONFIG_FILE # fix for docker restart: config data will append multiple times if [[ ! -f $CONFIG_FILE ]] then cat >"$CONFIG_FILE" <>"$CONFIG_FILE" echo "guest ok = yes" >>"$CONFIG_FILE" echo "public = yes" >>"$CONFIG_FILE" + echo "security = share" >>"$CONFIG_FILE" # for everyone without pwd else echo -n "for users: " users=$(echo "$users" |tr "," " ")