ubuntu etho0 up cron
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