diff --git a/assets/win10x64-enterprise-eval.xml b/assets/win10x64-enterprise-eval.xml index 7ea00ef..05a0437 100644 --- a/assets/win10x64-enterprise-eval.xml +++ b/assets/win10x64-enterprise-eval.xml @@ -420,11 +420,6 @@ 22 - cmd /C mklink /d %userprofile%\Desktop\Shared \\host.lan\Data - Create desktop shortcut to shared folder - - - 23 cmd /C if exist "C:\OEM\install.bat" start "Install" "cmd /C C:\OEM\install.bat" Execute custom script from the OEM folder if exists diff --git a/assets/win10x64-enterprise.xml b/assets/win10x64-enterprise.xml index 733d1ec..742a6d9 100644 --- a/assets/win10x64-enterprise.xml +++ b/assets/win10x64-enterprise.xml @@ -423,11 +423,6 @@ 22 - cmd /C mklink /d %userprofile%\Desktop\Shared \\host.lan\Data - Create desktop shortcut to shared folder - - - 23 cmd /C if exist "C:\OEM\install.bat" start "Install" "cmd /C C:\OEM\install.bat" Execute custom script from the OEM folder if exists diff --git a/assets/win10x64-iot.xml b/assets/win10x64-iot.xml index 01534bb..05ffaf5 100644 --- a/assets/win10x64-iot.xml +++ b/assets/win10x64-iot.xml @@ -429,11 +429,6 @@ 22 - cmd /C mklink /d %userprofile%\Desktop\Shared \\host.lan\Data - Create desktop shortcut to shared folder - - - 23 cmd /C if exist "C:\OEM\install.bat" start "Install" "cmd /C C:\OEM\install.bat" Execute custom script from the OEM folder if exists diff --git a/assets/win10x64-ltsc.xml b/assets/win10x64-ltsc.xml index e0e6c98..8700e26 100644 --- a/assets/win10x64-ltsc.xml +++ b/assets/win10x64-ltsc.xml @@ -426,11 +426,6 @@ 22 - cmd /C mklink /d %userprofile%\Desktop\Shared \\host.lan\Data - Create desktop shortcut to shared folder - - - 23 cmd /C if exist "C:\OEM\install.bat" start "Install" "cmd /C C:\OEM\install.bat" Execute custom script from the OEM folder if exists diff --git a/assets/win10x64.xml b/assets/win10x64.xml index 08e8c79..d863512 100644 --- a/assets/win10x64.xml +++ b/assets/win10x64.xml @@ -423,11 +423,6 @@ 22 - cmd /C mklink /d %userprofile%\Desktop\Shared \\host.lan\Data - Create desktop shortcut to shared folder - - - 23 cmd /C if exist "C:\OEM\install.bat" start "Install" "cmd /C C:\OEM\install.bat" Execute custom script from the OEM folder if exists diff --git a/assets/win11x64-enterprise-eval.xml b/assets/win11x64-enterprise-eval.xml index ae3384a..ea321ad 100644 --- a/assets/win11x64-enterprise-eval.xml +++ b/assets/win11x64-enterprise-eval.xml @@ -458,11 +458,6 @@ 25 - cmd /C mklink /d %userprofile%\Desktop\Shared \\host.lan\Data - Create desktop shortcut to shared folder - - - 26 cmd /C if exist "C:\OEM\install.bat" start "Install" "cmd /C C:\OEM\install.bat" Execute custom script from the OEM folder if exists diff --git a/assets/win11x64-enterprise.xml b/assets/win11x64-enterprise.xml index a9a192b..e76caad 100644 --- a/assets/win11x64-enterprise.xml +++ b/assets/win11x64-enterprise.xml @@ -461,11 +461,6 @@ 25 - cmd /C mklink /d %userprofile%\Desktop\Shared \\host.lan\Data - Create desktop shortcut to shared folder - - - 26 cmd /C if exist "C:\OEM\install.bat" start "Install" "cmd /C C:\OEM\install.bat" Execute custom script from the OEM folder if exists diff --git a/assets/win11x64-iot.xml b/assets/win11x64-iot.xml index 5a1b8ae..ae4282d 100644 --- a/assets/win11x64-iot.xml +++ b/assets/win11x64-iot.xml @@ -461,11 +461,6 @@ 25 - cmd /C mklink /d %userprofile%\Desktop\Shared \\host.lan\Data - Create desktop shortcut to shared folder - - - 26 cmd /C if exist "C:\OEM\install.bat" start "Install" "cmd /C C:\OEM\install.bat" Execute custom script from the OEM folder if exists diff --git a/assets/win11x64-ltsc.xml b/assets/win11x64-ltsc.xml index 8e4a969..bc27ec0 100644 --- a/assets/win11x64-ltsc.xml +++ b/assets/win11x64-ltsc.xml @@ -461,11 +461,6 @@ 25 - cmd /C mklink /d %userprofile%\Desktop\Shared \\host.lan\Data - Create desktop shortcut to shared folder - - - 26 cmd /C if exist "C:\OEM\install.bat" start "Install" "cmd /C C:\OEM\install.bat" Execute custom script from the OEM folder if exists diff --git a/assets/win11x64.xml b/assets/win11x64.xml index 76e7a79..53e73bb 100644 --- a/assets/win11x64.xml +++ b/assets/win11x64.xml @@ -461,11 +461,6 @@ 25 - cmd /C mklink /d %userprofile%\Desktop\Shared \\host.lan\Data - Create desktop shortcut to shared folder - - - 26 cmd /C if exist "C:\OEM\install.bat" start "Install" "cmd /C C:\OEM\install.bat" Execute custom script from the OEM folder if exists diff --git a/assets/win2008r2-eval.xml b/assets/win2008r2-eval.xml index f946b41..84467bd 100644 --- a/assets/win2008r2-eval.xml +++ b/assets/win2008r2-eval.xml @@ -290,11 +290,6 @@ 20 - cmd /C mklink /d %userprofile%\Desktop\Shared \\host.lan\Data - Create desktop shortcut to shared folder - - - 21 cmd /C if exist "C:\OEM\install.bat" start "Install" "cmd /C C:\OEM\install.bat" Execute custom script from the OEM folder if exists diff --git a/assets/win2008r2.xml b/assets/win2008r2.xml index df194be..9ab119f 100644 --- a/assets/win2008r2.xml +++ b/assets/win2008r2.xml @@ -293,11 +293,6 @@ 20 - cmd /C mklink /d %userprofile%\Desktop\Shared \\host.lan\Data - Create desktop shortcut to shared folder - - - 21 cmd /C if exist "C:\OEM\install.bat" start "Install" "cmd /C C:\OEM\install.bat" Execute custom script from the OEM folder if exists diff --git a/assets/win2012r2-eval.xml b/assets/win2012r2-eval.xml index f2f85ab..84bf8be 100644 --- a/assets/win2012r2-eval.xml +++ b/assets/win2012r2-eval.xml @@ -308,11 +308,6 @@ 17 - cmd /C mklink /d %userprofile%\Desktop\Shared \\host.lan\Data - Create desktop shortcut to shared folder - - - 18 cmd /C if exist "C:\OEM\install.bat" start "Install" "cmd /C C:\OEM\install.bat" Execute custom script from the OEM folder if exists diff --git a/assets/win2012r2.xml b/assets/win2012r2.xml index a6560aa..5eef789 100644 --- a/assets/win2012r2.xml +++ b/assets/win2012r2.xml @@ -311,11 +311,6 @@ 17 - cmd /C mklink /d %userprofile%\Desktop\Shared \\host.lan\Data - Create desktop shortcut to shared folder - - - 18 cmd /C if exist "C:\OEM\install.bat" start "Install" "cmd /C C:\OEM\install.bat" Execute custom script from the OEM folder if exists diff --git a/assets/win2016-eval.xml b/assets/win2016-eval.xml index ddaf919..45c1d82 100644 --- a/assets/win2016-eval.xml +++ b/assets/win2016-eval.xml @@ -328,11 +328,6 @@ 21 - cmd /C mklink /d %userprofile%\Desktop\Shared \\host.lan\Data - Create desktop shortcut to shared folder - - - 22 cmd /C if exist "C:\OEM\install.bat" start "Install" "cmd /C C:\OEM\install.bat" Execute custom script from the OEM folder if exists @@ -340,4 +335,3 @@ - diff --git a/assets/win2016.xml b/assets/win2016.xml index 398763c..019cd1c 100644 --- a/assets/win2016.xml +++ b/assets/win2016.xml @@ -331,11 +331,6 @@ 21 - cmd /C mklink /d %userprofile%\Desktop\Shared \\host.lan\Data - Create desktop shortcut to shared folder - - - 22 cmd /C if exist "C:\OEM\install.bat" start "Install" "cmd /C C:\OEM\install.bat" Execute custom script from the OEM folder if exists @@ -343,4 +338,3 @@ - diff --git a/assets/win2019-eval.xml b/assets/win2019-eval.xml index c518e92..e6db2d9 100644 --- a/assets/win2019-eval.xml +++ b/assets/win2019-eval.xml @@ -332,11 +332,6 @@ 21 - cmd /C mklink /d %userprofile%\Desktop\Shared \\host.lan\Data - Create desktop shortcut to shared folder - - - 22 cmd /C if exist "C:\OEM\install.bat" start "Install" "cmd /C C:\OEM\install.bat" Execute custom script from the OEM folder if exists @@ -344,4 +339,3 @@ - diff --git a/assets/win2019-hv.xml b/assets/win2019-hv.xml index 68c10cf..bb87975 100644 --- a/assets/win2019-hv.xml +++ b/assets/win2019-hv.xml @@ -337,11 +337,6 @@ 21 - cmd /C mklink /d %userprofile%\Desktop\Shared \\host.lan\Data - Create desktop shortcut to shared folder - - - 22 cmd /C if exist "C:\OEM\install.bat" start "Install" "cmd /C C:\OEM\install.bat" Execute custom script from the OEM folder if exists @@ -349,4 +344,3 @@ - diff --git a/assets/win2019.xml b/assets/win2019.xml index 0e7faea..5051f9f 100644 --- a/assets/win2019.xml +++ b/assets/win2019.xml @@ -335,11 +335,6 @@ 21 - cmd /C mklink /d %userprofile%\Desktop\Shared \\host.lan\Data - Create desktop shortcut to shared folder - - - 22 cmd /C if exist "C:\OEM\install.bat" start "Install" "cmd /C C:\OEM\install.bat" Execute custom script from the OEM folder if exists diff --git a/assets/win2022-eval.xml b/assets/win2022-eval.xml index e29daef..a4ed208 100644 --- a/assets/win2022-eval.xml +++ b/assets/win2022-eval.xml @@ -332,11 +332,6 @@ 21 - cmd /C mklink /d %userprofile%\Desktop\Shared \\host.lan\Data - Create desktop shortcut to shared folder - - - 22 cmd /C if exist "C:\OEM\install.bat" start "Install" "cmd /C C:\OEM\install.bat" Execute custom script from the OEM folder if exists @@ -344,4 +339,3 @@ - diff --git a/assets/win2022.xml b/assets/win2022.xml index cb54e5f..71c07c9 100644 --- a/assets/win2022.xml +++ b/assets/win2022.xml @@ -335,11 +335,6 @@ 21 - cmd /C mklink /d %userprofile%\Desktop\Shared \\host.lan\Data - Create desktop shortcut to shared folder - - - 22 cmd /C if exist "C:\OEM\install.bat" start "Install" "cmd /C C:\OEM\install.bat" Execute custom script from the OEM folder if exists @@ -347,4 +342,3 @@ - diff --git a/assets/win2025-eval.xml b/assets/win2025-eval.xml index 083812e..ff7f7fa 100644 --- a/assets/win2025-eval.xml +++ b/assets/win2025-eval.xml @@ -347,11 +347,6 @@ 23 - cmd /C mklink /d %userprofile%\Desktop\Shared \\host.lan\Data - Create desktop shortcut to shared folder - - - 24 cmd /C if exist "C:\OEM\install.bat" start "Install" "cmd /C C:\OEM\install.bat" Execute custom script from the OEM folder if exists @@ -359,4 +354,3 @@ - diff --git a/assets/win2025.xml b/assets/win2025.xml index bbee67f..c67965f 100644 --- a/assets/win2025.xml +++ b/assets/win2025.xml @@ -350,11 +350,6 @@ 23 - cmd /C mklink /d %userprofile%\Desktop\Shared \\host.lan\Data - Create desktop shortcut to shared folder - - - 24 cmd /C if exist "C:\OEM\install.bat" start "Install" "cmd /C C:\OEM\install.bat" Execute custom script from the OEM folder if exists diff --git a/assets/win7x64-enterprise-eval.xml b/assets/win7x64-enterprise-eval.xml index 69ef032..85b69e4 100644 --- a/assets/win7x64-enterprise-eval.xml +++ b/assets/win7x64-enterprise-eval.xml @@ -274,11 +274,6 @@ 18 - cmd /C mklink /d %userprofile%\Desktop\Shared \\host.lan\Data - Create desktop shortcut to shared folder - - - 19 cmd /C if exist "C:\OEM\install.bat" start "Install" "cmd /C C:\OEM\install.bat" Execute custom script from the OEM folder if exists diff --git a/assets/win7x64-enterprise.xml b/assets/win7x64-enterprise.xml index ef5873d..84c873e 100644 --- a/assets/win7x64-enterprise.xml +++ b/assets/win7x64-enterprise.xml @@ -278,11 +278,6 @@ 18 - cmd /C mklink /d %userprofile%\Desktop\Shared \\host.lan\Data - Create desktop shortcut to shared folder - - - 19 cmd /C if exist "C:\OEM\install.bat" start "Install" "cmd /C C:\OEM\install.bat" Execute custom script from the OEM folder if exists diff --git a/assets/win7x64-ultimate.xml b/assets/win7x64-ultimate.xml index 679811f..f17fb0e 100644 --- a/assets/win7x64-ultimate.xml +++ b/assets/win7x64-ultimate.xml @@ -278,11 +278,6 @@ 18 - cmd /C mklink /d %userprofile%\Desktop\Shared \\host.lan\Data - Create desktop shortcut to shared folder - - - 19 cmd /C if exist "C:\OEM\install.bat" start "Install" "cmd /C C:\OEM\install.bat" Execute custom script from the OEM folder if exists diff --git a/assets/win7x64.xml b/assets/win7x64.xml index db6a87f..be1f3a8 100644 --- a/assets/win7x64.xml +++ b/assets/win7x64.xml @@ -278,11 +278,6 @@ 18 - cmd /C mklink /d %userprofile%\Desktop\Shared \\host.lan\Data - Create desktop shortcut to shared folder - - - 19 cmd /C if exist "C:\OEM\install.bat" start "Install" "cmd /C C:\OEM\install.bat" Execute custom script from the OEM folder if exists diff --git a/assets/win7x86-enterprise.xml b/assets/win7x86-enterprise.xml index e7660ec..e96e5a7 100644 --- a/assets/win7x86-enterprise.xml +++ b/assets/win7x86-enterprise.xml @@ -278,11 +278,6 @@ 18 - cmd /C mklink /d %userprofile%\Desktop\Shared \\host.lan\Data - Create desktop shortcut to shared folder - - - 19 cmd /C if exist "C:\OEM\install.bat" start "Install" "cmd /C C:\OEM\install.bat" Execute custom script from the OEM folder if exists diff --git a/assets/win7x86-ultimate.xml b/assets/win7x86-ultimate.xml index f9486b5..ce81d12 100644 --- a/assets/win7x86-ultimate.xml +++ b/assets/win7x86-ultimate.xml @@ -278,11 +278,6 @@ 18 - cmd /C mklink /d %userprofile%\Desktop\Shared \\host.lan\Data - Create desktop shortcut to shared folder - - - 19 cmd /C if exist "C:\OEM\install.bat" start "Install" "cmd /C C:\OEM\install.bat" Execute custom script from the OEM folder if exists diff --git a/assets/win7x86.xml b/assets/win7x86.xml index 890d18d..314c2ee 100644 --- a/assets/win7x86.xml +++ b/assets/win7x86.xml @@ -278,11 +278,6 @@ 18 - cmd /C mklink /d %userprofile%\Desktop\Shared \\host.lan\Data - Create desktop shortcut to shared folder - - - 19 cmd /C if exist "C:\OEM\install.bat" start "Install" "cmd /C C:\OEM\install.bat" Execute custom script from the OEM folder if exists diff --git a/assets/win81x64-enterprise-eval.xml b/assets/win81x64-enterprise-eval.xml index 498e332..f3a61e9 100644 --- a/assets/win81x64-enterprise-eval.xml +++ b/assets/win81x64-enterprise-eval.xml @@ -293,11 +293,6 @@ 17 - cmd /C mklink /d %userprofile%\Desktop\Shared \\host.lan\Data - Create desktop shortcut to shared folder - - - 18 cmd /C if exist "C:\OEM\install.bat" start "Install" "cmd /C C:\OEM\install.bat" Execute custom script from the OEM folder if exists @@ -305,4 +300,3 @@ - diff --git a/assets/win81x64-enterprise.xml b/assets/win81x64-enterprise.xml index cebab90..bf927cc 100644 --- a/assets/win81x64-enterprise.xml +++ b/assets/win81x64-enterprise.xml @@ -296,11 +296,6 @@ 17 - cmd /C mklink /d %userprofile%\Desktop\Shared \\host.lan\Data - Create desktop shortcut to shared folder - - - 18 cmd /C if exist "C:\OEM\install.bat" start "Install" "cmd /C C:\OEM\install.bat" Execute custom script from the OEM folder if exists diff --git a/assets/win81x64.xml b/assets/win81x64.xml index eb764dd..290e923 100644 --- a/assets/win81x64.xml +++ b/assets/win81x64.xml @@ -303,11 +303,6 @@ 17 - cmd /C mklink /d %userprofile%\Desktop\Shared \\host.lan\Data - Create desktop shortcut to shared folder - - - 18 cmd /C if exist "C:\OEM\install.bat" start "Install" "cmd /C C:\OEM\install.bat" Execute custom script from the OEM folder if exists diff --git a/assets/winvistax64-enterprise.xml b/assets/winvistax64-enterprise.xml index 67e02fc..1e3709c 100644 --- a/assets/winvistax64-enterprise.xml +++ b/assets/winvistax64-enterprise.xml @@ -252,11 +252,6 @@ 23 - cmd /C mklink /d %userprofile%\Desktop\Shared \\host.lan\Data - Create desktop shortcut to shared folder - - - 24 cmd /C if exist "C:\OEM\install.bat" start "Install" "cmd /C C:\OEM\install.bat" Execute custom script from the OEM folder if exists diff --git a/assets/winvistax64-ultimate.xml b/assets/winvistax64-ultimate.xml index cdd73eb..cb1d1c1 100644 --- a/assets/winvistax64-ultimate.xml +++ b/assets/winvistax64-ultimate.xml @@ -252,11 +252,6 @@ 23 - cmd /C mklink /d %userprofile%\Desktop\Shared \\host.lan\Data - Create desktop shortcut to shared folder - - - 24 cmd /C if exist "C:\OEM\install.bat" start "Install" "cmd /C C:\OEM\install.bat" Execute custom script from the OEM folder if exists @@ -264,4 +259,3 @@ - diff --git a/assets/winvistax64.xml b/assets/winvistax64.xml index f2dc848..729e568 100644 --- a/assets/winvistax64.xml +++ b/assets/winvistax64.xml @@ -252,11 +252,6 @@ 23 - cmd /C mklink /d %userprofile%\Desktop\Shared \\host.lan\Data - Create desktop shortcut to shared folder - - - 24 cmd /C if exist "C:\OEM\install.bat" start "Install" "cmd /C C:\OEM\install.bat" Execute custom script from the OEM folder if exists @@ -264,4 +259,3 @@ - diff --git a/assets/winvistax86-enterprise.xml b/assets/winvistax86-enterprise.xml index 2e8b3b3..66efdf3 100644 --- a/assets/winvistax86-enterprise.xml +++ b/assets/winvistax86-enterprise.xml @@ -252,11 +252,6 @@ 23 - cmd /C mklink /d %userprofile%\Desktop\Shared \\host.lan\Data - Create desktop shortcut to shared folder - - - 24 cmd /C if exist "C:\OEM\install.bat" start "Install" "cmd /C C:\OEM\install.bat" Execute custom script from the OEM folder if exists @@ -264,4 +259,3 @@ - diff --git a/assets/winvistax86-ultimate.xml b/assets/winvistax86-ultimate.xml index 0cb6857..5231d50 100644 --- a/assets/winvistax86-ultimate.xml +++ b/assets/winvistax86-ultimate.xml @@ -252,11 +252,6 @@ 23 - cmd /C mklink /d %userprofile%\Desktop\Shared \\host.lan\Data - Create desktop shortcut to shared folder - - - 24 cmd /C if exist "C:\OEM\install.bat" start "Install" "cmd /C C:\OEM\install.bat" Execute custom script from the OEM folder if exists diff --git a/assets/winvistax86.xml b/assets/winvistax86.xml index c3a2302..ef0ed47 100644 --- a/assets/winvistax86.xml +++ b/assets/winvistax86.xml @@ -252,11 +252,6 @@ 23 - cmd /C mklink /d %userprofile%\Desktop\Shared \\host.lan\Data - Create desktop shortcut to shared folder - - - 24 cmd /C if exist "C:\OEM\install.bat" start "Install" "cmd /C C:\OEM\install.bat" Execute custom script from the OEM folder if exists @@ -264,4 +259,3 @@ - diff --git a/readme.md b/readme.md index 50a66b4..ede4afa 100644 --- a/readme.md +++ b/readme.md @@ -143,16 +143,19 @@ kubectl apply -f https://raw.githubusercontent.com/dockur/windows/refs/heads/mas ### How do I share files with the host? - After installation there will be a folder called `Shared` on your desktop, which can be used to exchange files with the host machine. + Open 'File Explorer' and click on the 'Network' section, you will see a computer called `host.lan`. - To select a folder on the host for this purpose, include the following bind mount in your compose file: + Double-click it and it will show a folder called `Data`, which can be bound to any folder on your host via the compose file: ```yaml volumes: - - ./example:/shared + - ./example:/data ``` - Replace the example path `./example` with your desired shared folder, which then will become visible as `Shared`. + The example folder `./example` will be available as ` \\host.lan\Data`. + +> [!TIP] +> You can map this path to a drive letter in Windows, for easier access. ### How do I change the amount of CPU or RAM? diff --git a/src/define.sh b/src/define.sh index 6edc4bd..f14e330 100644 --- a/src/define.sh +++ b/src/define.sh @@ -1777,18 +1777,11 @@ prepareInstall() { echo " Set oFile = Nothing" echo "End With" echo "" - echo "Set oLink = WshShell.CreateShortcut(WshShell.ExpandEnvironmentStrings(\"%userprofile%\\Desktop\\Shared.lnk\"))" - echo "With oLink" - echo " .TargetPath = \"\\\\host.lan\\Data\"" - echo " .Save" - echo "End With" - echo "Set oLink = Nothing" - echo "" - } | unix2dos > "$dir/\$OEM\$/install.vbs" + } | unix2dos > "$dir/\$OEM\$/admin.vbs" { echo "[COMMANDS]" echo "\"REGEDIT /s install.reg\"" - echo "\"Wscript install.vbs\"" + echo "\"Wscript admin.vbs\"" echo "" } | unix2dos > "$dir/\$OEM\$/cmdlines.txt" diff --git a/src/samba.sh b/src/samba.sh index af68071..ca54266 100644 --- a/src/samba.sh +++ b/src/samba.sh @@ -1,11 +1,7 @@ #!/usr/bin/env bash set -Eeuo pipefail -: "${SAMBA:="Y"}" # Enable Samba -: "${SAMBA_DEBUG:="N"}" # Disable debug -: "${SAMBA_LEVEL:="1"}" # Debug log level - -rm -rf /var/run/wsdd.pid +: "${SAMBA:="Y"}" [[ "$SAMBA" == [Nn]* ]] && return 0 [[ "$NETWORK" == [Nn]* ]] && return 0 @@ -22,7 +18,7 @@ if [[ "${NETWORK,,}" == "user"* ]]; then interface="127.0.0.1" fi -html "Initializing shared folder..." +html "Starting file sharing services..." [[ "$DEBUG" == [Yy1]* ]] && echo "Starting Samba daemon..." addShare() { @@ -42,18 +38,18 @@ addShare() { echo " For support visit $SUPPORT" echo "--------------------------------------------------------" echo "" - echo "Using this folder you can exchange files with the host machine." + echo "Using this folder you can share files with the host machine." echo "" - echo "To select the folder you want to share, include the following bind mount in your compose file:" + echo "To change its location, include the following bind mount in your compose file:" echo "" echo " volumes:" - echo " - \"./example:/${name,,}\"" + echo " - \"/home/example:/${name,,}\"" echo "" echo "Or in your run command:" echo "" - echo " -v \"\${PWD:-.}/example:/${name,,}\"" + echo " -v \"/home/example:/${name,,}\"" echo "" - echo "Replace the example path ./example with your desired shared folder." + echo "Replace the example path /home/example with the desired shared folder." echo "" } | unix2dos > "$dir/readme.txt" @@ -118,54 +114,27 @@ for dir in "${dirs[@]}"; do addShare "$dir" "$dir_name" "Shared $dir_name" || error "Failed to create shared folder for $dir!" done -# Try to repair Samba permissions +# Try to fix Samba permissions [ -d /run/samba/msg.lock ] && chmod -R 0755 /run/samba/msg.lock 2>/dev/null || : [ -d /var/log/samba/cores ] && chmod -R 0700 /var/log/samba/cores 2>/dev/null || : [ -d /var/cache/samba/msg.lock ] && chmod -R 0755 /var/cache/samba/msg.lock 2>/dev/null || : -rm -f /var/log/samba/log.smbd - -if ! smbd -l /var/log/samba; then - SAMBA_DEBUG="Y" - error "Failed to start Samba daemon!" -fi - -if [[ "$SAMBA_DEBUG" == [Yy1]* ]]; then - tail -fn +0 /var/log/samba/log.smbd & +if ! smbd; then + error "Samba daemon failed to start!" + smbd -i --debug-stdout || true fi if [[ "${BOOT_MODE:-}" == "windows_legacy" ]]; then - # Enable NetBIOS on Windows 7 and lower [[ "$DEBUG" == [Yy1]* ]] && echo "Starting NetBIOS daemon..." - - rm -f /var/log/samba/log.nmbd - - if ! nmbd -l /var/log/samba; then - SAMBA_DEBUG="Y" - error "Failed to start NetBIOS daemon!" + if ! nmbd; then + error "NetBIOS daemon failed to start!" + nmbd -i --debug-stdout || true fi - - if [[ "$SAMBA_DEBUG" == [Yy1]* ]]; then - tail -fn +0 /var/log/samba/log.nmbd & - fi - else - # Enable Web Service Discovery on Vista and up [[ "$DEBUG" == [Yy1]* ]] && echo "Starting Web Service Discovery daemon..." - - rm -f /var/log/wsddn.log - - if ! wsddn -i "$interface" -H "$hostname" --unixd --log-file=/var/log/wsddn.log --pid-file=/var/run/wsdd.pid; then - SAMBA_DEBUG="Y" - error "Failed to start WSDDN daemon!" - fi - - if [[ "$SAMBA_DEBUG" == [Yy1]* ]]; then - tail -fn +0 /var/log/wsddn.log & - fi - + wsddn -i "$interface" -H "$hostname" --pid-file=/var/run/wsdd.pid >/dev/null & fi return 0