I have a bash script in which I use the
ip r command. When I run the script in bash it works but when cron runs it it does not.
This is the line in my script:
ping -q -w 1 -c 1 `ip r | grep -m 1 default | cut -d ' ' -f 3` >/dev/null || exit
To test that the
ip r command is the problem I added
notify-send "TEST $(ip r)" in front of that line. When I execute the script in bash it sends the notification with TEST and the output of
ip r but when run with cron the notification only contains