1
2
I have a script in /etc/network/if-up.d
to connect to my VPN on startup. It appears that the script is running three times and therefore connecting to my VPN three times. After startup, looking at sudo ifconfig
verifies that, in fact, three tunnels have been created. Also, I can see all three openvpn daemons when looking at the output from ps aux
. How do I make sure it only runs once? And why is it running more than once? I am running Debian 7.3.
The contents of /etc/network/if-up.d/connectvpn
are:
#!/bin/sh
/usr/sbin/openvpn --daemon --keepalive 5 30 --config /etc/openvpn/configs/bitterroot.conf
Thank you for your help! Jeff
Why aren't you checking the passed arguments? – Ignacio Vazquez-Abrams – 2013-12-31T22:09:27.357
@IgnacioVazquez-Abrams I'm sorry, I'm not sure what you mean by checking the passed arguments. Could you explain further? Thank you. – Jeff Erickson – 2013-12-31T22:10:44.160
$1
,$2
, etc. – Ignacio Vazquez-Abrams – 2013-12-31T22:11:26.477@IgnacioVazquez-Abrams There are no passed arguments to the actual script
/etc/network/if-up.d/connectvpn
. It just runs as-is w/o arguments. – Jeff Erickson – 2013-12-31T22:14:01.860