Restore functionality of disable-default-route and disable-dns-server.

This commit is contained in:
Gregorio Guidi 2016-12-31 21:50:29 +01:00 committed by Marek Marczykowski-Górecki
parent 7787d39b6e
commit 1ca110a9fd
No known key found for this signature in database
GPG Key ID: 063938BA42CFA724

View File

@ -51,19 +51,19 @@ __EOF__
/sbin/ifconfig $INTERFACE $ip netmask 255.255.255.255
/sbin/ifconfig $INTERFACE up
/sbin/route add -host $gateway dev $INTERFACE
if [ "x$disablegw" != "x1" ]; then
if ! qsvc disable-default-route ; then
/sbin/route add default gw $gateway
fi
if ! is_protected_file /etc/resolv.conf ; then
echo > /etc/resolv.conf
if [ "x$disabledns" != "x1" ]; then
if ! qsvc disable-dns-server ; then
echo "nameserver $primary_dns" > /etc/resolv.conf
echo "nameserver $secondary_dns" >> /etc/resolv.conf
fi
fi
fi
network=$(qubesdb-read /qubes-netvm-network 2>/dev/null)
if [ "x$network" != "x" ] && [ "x$disabledns" != "x1" ]; then
if [ "x$network" != "x" ] && ! qsvc disable-dns-server ; then
gateway=$(qubesdb-read /qubes-netvm-gateway)
netmask=$(qubesdb-read /qubes-netvm-netmask)
primary_dns=$(qubesdb-read /qubes-netvm-primary-dns 2>/dev/null || echo $gateway)