1
0
mirror of https://github.com/dockur/windows.git synced 2026-06-11 12:49:36 +08:00

feat: Improved start and stop logic (#1758)

This commit is contained in:
Kroese
2026-06-04 22:37:18 +02:00
committed by GitHub
parent bcae867d68
commit 8d2f27bd67
3 changed files with 120 additions and 138 deletions
+6 -5
View File
@@ -7,9 +7,11 @@ set -Eeuo pipefail
tmp="/tmp/smb"
rm -rf "$tmp"
rm -f /var/run/wsdd.pid
rm -f /var/run/samba/nmbd.pid
rm -f /var/run/samba/smbd.pid
DDN_PID="/var/run/wsdd.pid"
NMB_PID="/var/run/samba/nmbd.pid"
SMB_PID="/var/run/samba/smbd.pid"
rm -f "$SMB_PID" "$NMB_PID" "$DDN_PID"
[[ "$SAMBA" == [Nn]* ]] && return 0
[[ "$NETWORK" == [Nn]* ]] && return 0
@@ -206,10 +208,9 @@ else
# Enable Web Service Discovery on Vista and up
[[ "$DEBUG" == [Yy1]* ]] && echo "Starting wsddn daemon..."
rm -f /var/log/wsddn.log
if ! wsddn -i "${interfaces%%,*}" -H "$hostname" --unixd --log-file=/var/log/wsddn.log --pid-file=/var/run/wsdd.pid; then
if ! wsddn -i "${interfaces%%,*}" -H "$hostname" --unixd --log-file=/var/log/wsddn.log --pid-file="$DDN_PID"; then
SAMBA_DEBUG="Y"
error "Failed to start wsddn daemon!"
fi