mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-07-29 13:38:00 +00:00
Merge pull request #130 from djs55/tap
Add Hyper-V sockets to ethernet proxy
This commit is contained in:
commit
c779594ab4
@ -41,6 +41,7 @@ COPY packages/proxy/etc /etc/
|
||||
COPY packages/transfused/transfused /sbin/
|
||||
COPY packages/transfused/etc /etc/
|
||||
COPY packages/tap-vsockd/tap-vsockd /sbin/
|
||||
COPY packages/tap-vsockd/etc /etc/
|
||||
COPY packages/llmnrd/llmnrd /sbin/
|
||||
COPY packages/llmnrd/etc /etc/
|
||||
COPY packages/llmnrd/llmnrd.tar.gz /usr/share/src/
|
||||
|
@ -9,3 +9,5 @@ auto eth1
|
||||
iface eth1 inet dhcp
|
||||
udhcpc_opts -T 1 -A 3
|
||||
metric 199
|
||||
pre-up service tap-vsockd start
|
||||
post-down service tap-vsockd stop
|
||||
|
43
alpine/packages/tap-vsockd/etc/init.d/tap-vsockd
Executable file
43
alpine/packages/tap-vsockd/etc/init.d/tap-vsockd
Executable file
@ -0,0 +1,43 @@
|
||||
#!/sbin/openrc-run
|
||||
|
||||
description="VPN proxy"
|
||||
|
||||
depend()
|
||||
{
|
||||
before networking
|
||||
}
|
||||
|
||||
start()
|
||||
{
|
||||
if mobyconfig exists network
|
||||
then
|
||||
NETWORK_MODE="$(mobyconfig get network | tr -d '[[:space:]]')"
|
||||
if [ "${NETWORK_MODE}" = "hybrid" ]; then
|
||||
|
||||
ebegin "Starting VPN proxy"
|
||||
|
||||
PIDFILE=/var/run/tap-vsockd.pid
|
||||
start-stop-daemon --start --quiet \
|
||||
--exec /sbin/tap-vsockd \
|
||||
--pidfile ${PIDFILE} \
|
||||
-- \
|
||||
--daemon \
|
||||
--pidfile "${PIDFILE}" \
|
||||
--listen
|
||||
|
||||
eend $? "Failed to start VPN proxy"
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
stop()
|
||||
{
|
||||
ebegin "Stopping VPN proxy"
|
||||
|
||||
PIDFILE=/var/run/tap-vsockd.pid
|
||||
|
||||
start-stop-daemon --stop --quiet \
|
||||
--pidfile "${PIDFILE}"
|
||||
|
||||
eend $? "Failed to stop VPN proxy"
|
||||
}
|
Loading…
Reference in New Issue
Block a user