diff --git a/include/functions b/include/functions index b013555..07ffaa4 100644 --- a/include/functions +++ b/include/functions @@ -145,9 +145,18 @@ function apply_ipv4_hack { # I have things going through specific wires for a reason. This fixes # that and makes it behave as expected. display_c PURPLE " MULTI-NIC-ARP-LOCK" + PROC_NET_IPV4="/proc/sys/net/ipv4/conf" for i in default all; do - echo "1" > /proc/sys/net/ipv4/conf/$i/arp_ignore - echo "2" > /proc/sys/net/ipv4/conf/$i/arp_announce + if [ -w ${PROC_NET_IPV4}/$i/arp_ignore ]; then + echo "1" > ${PROC_NET_IPV4}/$i/arp_ignore + else + display_c RED "\nError: Could not write to ${PROC_NET_IPV4}/$i/arp_ignore" + fi + if [ -w ${PROC_NET_IPV4}/$i/arp_announce ]; then + echo "2" > ${PROC_NET_IPV4}/$i/arp_announce + else + display_c RED "\nError: Could not write to ${PROC_NET_IPV4}/$i/arp_announce" + fi done ;; esac