mirror of
https://github.com/dockur/windows.git
synced 2025-10-27 03:15:49 +00:00
Compare commits
6 commits
314287071f
...
a098158beb
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a098158beb | ||
|
|
7a0be8950c | ||
|
|
c04851bbd4 | ||
|
|
588242b175 | ||
|
|
3ab5c25152 | ||
|
|
17db1ac34c |
2 changed files with 33 additions and 16 deletions
10
src/power.sh
10
src/power.sh
|
|
@ -103,11 +103,19 @@ finish() {
|
||||||
|
|
||||||
pid="/var/run/tpm.pid"
|
pid="/var/run/tpm.pid"
|
||||||
[ -s "$pid" ] && pKill "$(<"$pid")"
|
[ -s "$pid" ] && pKill "$(<"$pid")"
|
||||||
|
rm -f "$pid"
|
||||||
|
|
||||||
pid="/var/run/wsdd.pid"
|
pid="/var/run/wsdd.pid"
|
||||||
[ -s "$pid" ] && pKill "$(<"$pid")"
|
[ -s "$pid" ] && pKill "$(<"$pid")"
|
||||||
|
rm -f "$pid"
|
||||||
|
|
||||||
fKill "smbd"
|
pid="/var/run/samba/nmbd.pid"
|
||||||
|
[ -s "$pid" ] && pKill "$(<"$pid")"
|
||||||
|
rm -f "$pid"
|
||||||
|
|
||||||
|
pid="/var/run/samba/smbd.pid"
|
||||||
|
[ -s "$pid" ] && pKill "$(<"$pid")"
|
||||||
|
rm -f "$pid"
|
||||||
|
|
||||||
closeNetwork
|
closeNetwork
|
||||||
|
|
||||||
|
|
|
||||||
35
src/samba.sh
35
src/samba.sh
|
|
@ -7,27 +7,30 @@ set -Eeuo pipefail
|
||||||
|
|
||||||
tmp="/tmp/smb"
|
tmp="/tmp/smb"
|
||||||
rm -rf "$tmp"
|
rm -rf "$tmp"
|
||||||
rm -rf /var/run/wsdd.pid
|
|
||||||
|
rm -f /var/run/wsdd.pid
|
||||||
|
rm -f /var/run/samba/nmbd.pid
|
||||||
|
rm -f /var/run/samba/smbd.pid
|
||||||
|
|
||||||
[[ "$SAMBA" == [Nn]* ]] && return 0
|
[[ "$SAMBA" == [Nn]* ]] && return 0
|
||||||
[[ "$NETWORK" == [Nn]* ]] && return 0
|
[[ "$NETWORK" == [Nn]* ]] && return 0
|
||||||
|
|
||||||
hostname="host.lan"
|
|
||||||
interfaces="dockerbridge"
|
|
||||||
|
|
||||||
if [ -n "${SAMBA_INTERFACE:-}" ]; then
|
|
||||||
interfaces+=",$SAMBA_INTERFACE"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ "$DHCP" == [Yy1]* ]]; then
|
if [[ "$DHCP" == [Yy1]* ]]; then
|
||||||
|
socket="$IP"
|
||||||
hostname="$IP"
|
hostname="$IP"
|
||||||
interfaces="$VM_NET_DEV"
|
interfaces="$VM_NET_DEV"
|
||||||
fi
|
else
|
||||||
|
hostname="host.lan"
|
||||||
if [[ "${NETWORK,,}" == "user"* ]]; then
|
case "${NETWORK,,}" in
|
||||||
|
"passt" | "slirp" )
|
||||||
interfaces="lo"
|
interfaces="lo"
|
||||||
if ! ip link set "$interfaces" multicast on >/dev/null; then
|
socket="127.0.0.1" ;;
|
||||||
warn "Failed to enable multicast on loopback interface!"
|
*)
|
||||||
|
socket="$VM_NET_IP"
|
||||||
|
interfaces="$VM_NET_BRIDGE" ;;
|
||||||
|
esac
|
||||||
|
if [ -n "${SAMBA_INTERFACE:-}" ]; then
|
||||||
|
interfaces+=",$SAMBA_INTERFACE"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
@ -98,6 +101,7 @@ addShare() {
|
||||||
echo " follow symlinks = yes"
|
echo " follow symlinks = yes"
|
||||||
echo " wide links = yes"
|
echo " wide links = yes"
|
||||||
echo " unix extensions = no"
|
echo " unix extensions = no"
|
||||||
|
echo " socket address = $socket"
|
||||||
echo ""
|
echo ""
|
||||||
echo " # disable printing services"
|
echo " # disable printing services"
|
||||||
echo " load printers = no"
|
echo " load printers = no"
|
||||||
|
|
@ -158,6 +162,11 @@ if [[ "$SAMBA_DEBUG" == [Yy1]* ]]; then
|
||||||
tail -fn +0 /var/log/samba/log.smbd &
|
tail -fn +0 /var/log/samba/log.smbd &
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
case "${NETWORK,,}" in
|
||||||
|
"user"* | "passt" | "slirp" )
|
||||||
|
return 0 ;;
|
||||||
|
esac
|
||||||
|
|
||||||
if [[ "${BOOT_MODE:-}" == "windows_legacy" ]]; then
|
if [[ "${BOOT_MODE:-}" == "windows_legacy" ]]; then
|
||||||
|
|
||||||
# Enable NetBIOS on Windows 7 and lower
|
# Enable NetBIOS on Windows 7 and lower
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue