2
rated 0 times
[
2]
[
0]
/ answers: 1 / hits: 775
/ 2 Years ago, tue, november 15, 2022, 11:11:59
I try to detect if there is a network link (cable plugged/unplugged) in an upstart script (Ubuntu 12.04). Here the relevant part of my script (which didndt work):
script
if [ /sbin/ethtool eth0 | /bin/grep "Link detected: yes" > /dev/null ] ; then
exec prog1
else
exec prog2
fi
end script
(try to start prog1 if there is a link otherwise prog2.) How to fix that?
More From » upstart