From 01bffba271cb6ffe0cc308549c70fd460d501bef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luis=20Mu=C3=B1iz?= <2011450+luisgmuniz@users.noreply.github.com> Date: Thu, 30 May 2024 13:38:36 +0200 Subject: [PATCH] feat: optionally disable creation of readme.txt on the shared folder --- readme.md | 7 +++++++ src/define.sh | 1 + src/samba.sh | 41 ++++++++++++++++++++++------------------- 3 files changed, 30 insertions(+), 19 deletions(-) diff --git a/readme.md b/readme.md index 44d461a..c15c683 100644 --- a/readme.md +++ b/readme.md @@ -161,6 +161,13 @@ kubectl apply -f kubernetes.yml The example folder `/home/user/example` will be available as ` \\host.lan\Data`. You can optionally map this path to a drive letter in Windows, for easier access. + At boot, the file `readme.txt` will be created on the folder unless you disable it: + + ```yaml + environment: + README: "N" + ``` + * ### How do I install a custom image? In order to download an unsupported ISO image that is not selectable from the list above, specify the URL of that ISO in the `VERSION` environment variable, for example: diff --git a/src/define.sh b/src/define.sh index c9e776a..a1f909d 100644 --- a/src/define.sh +++ b/src/define.sh @@ -11,6 +11,7 @@ set -Eeuo pipefail : "${LANGUAGE:=""}" : "${USERNAME:=""}" : "${PASSWORD:=""}" +: "${README:=""}" MIRRORS=5 PLATFORM="x64" diff --git a/src/samba.sh b/src/samba.sh index b6f4654..c54f0ee 100644 --- a/src/samba.sh +++ b/src/samba.sh @@ -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$( "$share/readme.txt" +if [[ "$README" == [Yy1]* ]] ;then + { echo "--------------------------------------------------------" + echo " $APP for Docker v$( "$share/readme.txt" +fi ! smbd && smbd --debug-stdout