xuxiuxi
2017-07-24 be1c28a5a6edd5a76b04d9ce3b6eaf7bcc3b818d
ProxyConsole/auto-net-ip.sh
@@ -1,12 +1,12 @@
#!/bin/sh
#crontab:
#*/2 * * * * /bin/sh /opt/auto-net-ip.sh > /dev/null 2>&1
HAS_NET=`ifconfig | grep enp1s0 | grep 172.16`
if [ -z "$HAS_NET" ]; then
   echo "set ip address"
   ifconfig enp1s0 172.16.23.10/16
   ifconfig enp2s0 192.168.1.100/24
fi
#!/bin/sh
#crontab:
#*/2 * * * * /bin/sh /opt/auto-net-ip.sh > /dev/null 2>&1
HAS_NET=`ifconfig | grep enp1s0 -A 1 | grep 172.16`
if [ -z "$HAS_NET" ]; then
   echo "set ip address"
   ifconfig enp1s0 172.16.24.10/16
   ifconfig enp2s0 192.168.1.100/24
fi