Check for xenstore-read in /usr/sbin as well (default on debian)
This commit is contained in:
parent
0a9199623c
commit
2ddea415b2
@ -1,10 +1,16 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
ip=`/usr/bin/xenstore-read qubes-ip 2> /dev/null`
|
if [ -x /usr/sbin/xenstore-read ]; then
|
||||||
|
XENSTORE_READ="/usr/sbin/xenstore-read"
|
||||||
|
else
|
||||||
|
XENSTORE_READ="$XENSTORE_READ"
|
||||||
|
fi
|
||||||
|
|
||||||
|
ip=`$XENSTORE_READ qubes-ip 2> /dev/null`
|
||||||
if [ x$ip != x ]; then
|
if [ x$ip != x ]; then
|
||||||
netmask=`/usr/bin/xenstore-read qubes-netmask`
|
netmask=`$XENSTORE_READ qubes-netmask`
|
||||||
gateway=`/usr/bin/xenstore-read qubes-gateway`
|
gateway=`$XENSTORE_READ qubes-gateway`
|
||||||
secondary_dns=`/usr/bin/xenstore-read qubes-secondary-dns`
|
secondary_dns=`$XENSTORE_READ qubes-secondary-dns`
|
||||||
/sbin/ifconfig $INTERFACE $ip netmask 255.255.255.255
|
/sbin/ifconfig $INTERFACE $ip netmask 255.255.255.255
|
||||||
/sbin/ifconfig $INTERFACE up
|
/sbin/ifconfig $INTERFACE up
|
||||||
/sbin/route add -host $gateway dev $INTERFACE
|
/sbin/route add -host $gateway dev $INTERFACE
|
||||||
@ -13,11 +19,11 @@ if [ x$ip != x ]; then
|
|||||||
/sbin/ethtool -K $INTERFACE tx off
|
/sbin/ethtool -K $INTERFACE tx off
|
||||||
echo "nameserver $gateway" > /etc/resolv.conf
|
echo "nameserver $gateway" > /etc/resolv.conf
|
||||||
echo "nameserver $secondary_dns" >> /etc/resolv.conf
|
echo "nameserver $secondary_dns" >> /etc/resolv.conf
|
||||||
network=$(/usr/bin/xenstore-read qubes-netvm-network 2>/dev/null)
|
network=$($XENSTORE_READ qubes-netvm-network 2>/dev/null)
|
||||||
if [ "x$network" != "x" ]; then
|
if [ "x$network" != "x" ]; then
|
||||||
gateway=$(/usr/bin/xenstore-read qubes-netvm-gateway)
|
gateway=$($XENSTORE_READ qubes-netvm-gateway)
|
||||||
netmask=$(/usr/bin/xenstore-read qubes-netvm-netmask)
|
netmask=$($XENSTORE_READ qubes-netvm-netmask)
|
||||||
secondary_dns=$(/usr/bin/xenstore-read qubes-netvm-secondary-dns)
|
secondary_dns=$($XENSTORE_READ qubes-netvm-secondary-dns)
|
||||||
echo "NS1=$gateway" > /var/run/qubes/qubes-ns
|
echo "NS1=$gateway" > /var/run/qubes/qubes-ns
|
||||||
echo "NS2=$secondary_dns" >> /var/run/qubes/qubes-ns
|
echo "NS2=$secondary_dns" >> /var/run/qubes/qubes-ns
|
||||||
/usr/lib/qubes/qubes-setup-dnat-to-ns
|
/usr/lib/qubes/qubes-setup-dnat-to-ns
|
||||||
|
Loading…
Reference in New Issue
Block a user