Escape Percent-signs (%) in crontab
In order to input
% character as command parameter in cron task, it needs to be escaped using backslash ().
man (5) crontab:
Percent-signs (%) in the command, unless escaped with backslash (\),
will be changed into newline characters, and all data after the
first % will be sent to the command as standard input.
Run script after interface up when using NetworkManager
Create a script as below in folder
10-openvpn-tun0-up, change the permission to executable
if [[ $interface != "eth0" ]] || [[ $event != "up" ]]
# place your commands bellow this line
Network Manager script when interface up?