From e50f516bd235634434bd9ea1a1aaf879c377ef2c Mon Sep 17 00:00:00 2001 From: Kroese Date: Wed, 7 Feb 2024 23:58:05 +0100 Subject: [PATCH 1/4] Update Dockerfile --- Dockerfile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Dockerfile b/Dockerfile index 2370d5e..614419d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,7 +9,10 @@ RUN apt-get update \ && apt-get --no-install-recommends -y install \ curl \ 7zip \ + wsdd \ + samba \ wimtools \ + dos2unix \ cabextract \ genisoimage \ libxml2-utils \ From ec1ebd60355aeab39ca4ee092a55a1f80667e433 Mon Sep 17 00:00:00 2001 From: Kroese Date: Wed, 7 Feb 2024 23:58:58 +0100 Subject: [PATCH 2/4] Update entry.sh --- src/entry.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/src/entry.sh b/src/entry.sh index 2426576..7402870 100644 --- a/src/entry.sh +++ b/src/entry.sh @@ -12,6 +12,7 @@ cd /run . disk.sh # Initialize disks . display.sh # Initialize graphics . network.sh # Initialize network +. samba.sh # Configure samba . boot.sh # Configure boot . proc.sh # Initialize processor . power.sh # Configure shutdown From 98e8c4011eeace85eaae83031f4489adb0b309f0 Mon Sep 17 00:00:00 2001 From: Kroese Date: Thu, 8 Feb 2024 00:00:13 +0100 Subject: [PATCH 3/4] Update power.sh --- src/power.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/power.sh b/src/power.sh index 1d5abb5..cc50fd1 100644 --- a/src/power.sh +++ b/src/power.sh @@ -64,6 +64,9 @@ finish() { pid="/var/run/tpm.pid" [ -f "$pid" ] && pKill "$(<"$pid")" + fKill "wsdd" + fKill "smbd" + closeNetwork sleep 0.5 From 8d50d65968c5541312c860b98597e3570cad370b Mon Sep 17 00:00:00 2001 From: Kroese Date: Thu, 8 Feb 2024 00:01:20 +0100 Subject: [PATCH 4/4] Create samba.sh --- src/samba.sh | 63 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 src/samba.sh diff --git a/src/samba.sh b/src/samba.sh new file mode 100644 index 0000000..03d1e8b --- /dev/null +++ b/src/samba.sh @@ -0,0 +1,63 @@ +#!/usr/bin/env bash +set -Eeuo pipefail + +[[ "$DHCP" == [Yy1]* ]] && return 0 + +SHARE="$STORAGE/shared" + +mkdir -p "$SHARE" +chmod -R 777 "$SHARE" + +SAMBA="/etc/samba/smb.conf" + +{ echo "[global]" + echo " server string = Dockur" + echo " netbios name = dockur" + echo " workgroup = WORKGROUP" + echo " interfaces = dockerbridge" + echo " bind interfaces only = yes" + echo " security = user" + echo " guest account = nobody" + echo " map to guest = Bad User" + echo " server min protocol = SMB2" + echo "" + echo " # disable printing services" + echo " load printers = no" + echo " printing = bsd" + echo " printcap name = /dev/null" + echo " disable spoolss = yes" + echo "" + echo "[Data]" + echo " path = $SHARE" + echo " comment = Shared" + echo " writable = yes" + echo " guest ok = yes" + echo " guest only = yes" + echo " force user = root" + echo " force group = root" +} > "$SAMBA" + +{ echo "--------------------------------------------------------" + echo " $APP for Docker v$( "$SHARE/readme.txt" + +smbd -D +wsdd -i dockerbridge -p -n "host.local" & + +return 0