Created
July 29, 2011 13:14
-
-
Save pelletier/1113784 to your computer and use it in GitHub Desktop.
/etc/rc.d/network patch for Vagrant with Archlinux. Makes `gateway` not required.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- network.orig | |
+++ network | |
@@ -25,16 +25,16 @@ | |
network_up() { | |
/usr/sbin/ip link set dev $interface up || return 1 | |
if [[ $address ]]; then | |
- for var in netmask gateway; do | |
+ for var in netmask ; do | |
if [[ -z ${!var} ]]; then | |
printf "${C_FAIL}Error: static address defined without $var!\n" | |
return 1 | |
fi | |
done | |
/usr/sbin/ip addr add $address/$netmask dev $interface || return 1 | |
- /usr/sbin/ip route add default via $gateway || return 1 | |
+ [[ $gateway ]] && { /usr/sbin/ip route add default via $gateway || return 1; } | |
else | |
/sbin/dhcpcd $DHCPCD_ARGS $interface || return 1 | |
fi | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment