Merge pull request #309 from justincormack/tapvsockvmbus

Use mobyplatform not vmbus for tap-vsock
This commit is contained in:
Rolf Neugebauer 2016-07-21 10:34:57 +01:00 committed by GitHub
commit 423b3c2765
2 changed files with 18 additions and 25 deletions

View File

@ -12,7 +12,7 @@ then
FUSE=$(ps -eo args | grep '^/sbin/transfused')
[ $? -eq 0 ] && printf "✓ Process transfused running\n" || printf "✗ No transfused process\n"
fi
if [ -d /sys/bus/vmbus ]
if [ [ "$(mobyplatform)" = "windows" ] ]
then
TAPVS=$(ps -eo args | grep '^/sbin/tap-vsockd')
[ $? -eq 0 ] && printf "✓ Process tap-vsockd running\n" || printf "✗ No tap-vsockd process\n"

View File

@ -9,37 +9,30 @@ depend()
start()
{
if [ ! -d /sys/bus/vmbus ]; then
# skip if not on Hyper-V
exit 0
fi
if mobyconfig exists network
then
NETWORK_MODE="$(mobyconfig get network | tr -d '[[:space:]]')"
if [ "${NETWORK_MODE}" = "hybrid" ]; then
[ "$(mobyplatform)" != "windows" ] && exit 0
ebegin "Starting VPN proxy"
mobyconfig exists network || exit 0
NETWORK_MODE="$(mobyconfig get network | tr -d '[[:space:]]')"
[ "${NETWORK_MODE}" = "hybrid" ] || exit 0
PIDFILE=/var/run/tap-vsockd.pid
start-stop-daemon --start \
--exec /sbin/tap-vsockd \
--background \
--pidfile ${PIDFILE} \
-- \
--pidfile "${PIDFILE}" \
--listen
ebegin "Starting VPN proxy"
eend $? "Failed to start VPN proxy"
fi
fi
PIDFILE=/var/run/tap-vsockd.pid
start-stop-daemon --start \
--exec /sbin/tap-vsockd \
--background \
--pidfile ${PIDFILE} \
-- \
--pidfile "${PIDFILE}" \
--listen
eend $? "Failed to start VPN proxy"
}
stop()
{
if [ ! -d /sys/bus/vmbus ]; then
# skip if not on Hyper-V
exit 0
fi
[ "$(mobyplatform)" != "windows" ] && exit 0
ebegin "Stopping VPN proxy"
PIDFILE=/var/run/tap-vsockd.pid