feat: optionally disable creation of readme.txt on the shared folder

This commit is contained in:
Luis Muñiz 2024-05-30 13:38:36 +02:00
parent 651bbe74eb
commit 01bffba271
3 changed files with 30 additions and 19 deletions

View file

@ -11,6 +11,7 @@ set -Eeuo pipefail
: "${LANGUAGE:=""}"
: "${USERNAME:=""}"
: "${PASSWORD:=""}"
: "${README:=""}"
MIRRORS=5
PLATFORM="x64"

View file

@ -1,6 +1,7 @@
#!/usr/bin/env bash
set -Eeuo pipefail
: "${README:="Y"}"
: "${SAMBA:="Y"}"
[[ "$SAMBA" != [Yy1]* ]] && return 0
@ -50,25 +51,27 @@ mkdir -p "$share"
echo " force group = root"
} > "/etc/samba/smb.conf"
{ echo "--------------------------------------------------------"
echo " $APP for Docker v$(</run/version)..."
echo " For support visit $SUPPORT"
echo "--------------------------------------------------------"
echo ""
echo "Using this folder you can share files with the host machine."
echo ""
echo "To change its location, include the following bind mount in your compose file:"
echo ""
echo " volumes:"
echo " - \"/home/user/example:/shared\""
echo ""
echo "Or in your run command:"
echo ""
echo " -v \"/home/user/example:/shared\""
echo ""
echo "Replace the example path /home/user/example with the desired shared folder."
echo ""
} | unix2dos > "$share/readme.txt"
if [[ "$README" == [Yy1]* ]] ;then
{ echo "--------------------------------------------------------"
echo " $APP for Docker v$(</run/version)..."
echo " For support visit $SUPPORT"
echo "--------------------------------------------------------"
echo ""
echo "Using this folder you can share files with the host machine."
echo ""
echo "To change its location, include the following bind mount in your compose file:"
echo ""
echo " volumes:"
echo " - \"/home/user/example:/shared\""
echo ""
echo "Or in your run command:"
echo ""
echo " -v \"/home/user/example:/shared\""
echo ""
echo "Replace the example path /home/user/example with the desired shared folder."
echo ""
} | unix2dos > "$share/readme.txt"
fi
! smbd && smbd --debug-stdout