标签:bin == car sleep ifconfig done chmod echo ash
sudo touch if_interface_up.sh
sudo chmod 777 if_interface_up.sh
sudo vi if_interface_up.sh
#!/bin/bash
while true
do
result=`cat /sys/class/net/enp0/carrier`
echo ${result}
if [ ${result} == ‘0‘ ]; then
`ifconfig enp0 up`
else
`sleep 1`
fi
done
sudo vi /etc/rc.local
/home/hbg/if_interface_up.sh
标签:bin == car sleep ifconfig done chmod echo ash
原文地址:https://www.cnblogs.com/rohens-hbg/p/13080301.html