Page 1 of 1

I wish there was a command to RING A BELL when OpenVpn connects!

Posted: Sat Jul 01, 2017 12:22 pm
by woodrock
I wish there was a way to tell the OpenVPN Daemon to RING A BELL when OpenVpn connects!
Image
My Windows OpenVPN use model is described here, where I simply select a score of recently downloaded public openvpn files from vpngate.net to open in the OpenVPN Daemon, and where only one command window makes the connection, while the rest of the command windows die of their own accord within minutes.

Given it takes time, I have to keep checking; but if an audible bell were rung upon a successful connection, it would be more efficient!

Re: I wish there was a command to RING A BELL when OpenVpn connects!

Posted: Mon Jul 10, 2017 12:57 am
by Skaperen
an app that can ring your bell and can scan the log file for the right text, or ping a known host via the tunnel, could solve your need.

Re: I wish there was a command to RING A BELL when OpenVpn connects!

Posted: Sun Sep 03, 2017 10:42 am
by woodrock
Skaperen wrote:an app that can ring your bell and can scan the log file for the right text, or ping a known host via the tunnel, could solve your need.
This may very well be true, and I appreciate the advice since nobody has to offer any advice.
However, unfortunately, I have two responses to that which negate it as a practical matter:

1. This thread is expressly for the openvpn app to add the feature, not for a second unrelated app to add the feature. :)
2. Besides, nobody knows how (yet) to make a secondary app ring the bell either.

For details on the second issue above, see the related thread exactly asking HOW to ring a bell (any way possible) when OpenVPN connects:
* How can I get OpenVPN Daemon to ring a bell upon "Initialization sequence completed

After two months, we still have been unable to even get a secondary app to ring a bell upon OpenVPN completion.

Re: I wish there was a command to RING A BELL when OpenVpn connects!

Posted: Tue Sep 05, 2017 9:59 am
by klanimantsi
Hmm, yea now that you say it I think that would be a handy feature:)

Re: I wish there was a command to RING A BELL when OpenVpn connects!

Posted: Wed Sep 20, 2017 1:27 am
by x9p
My sugestion is for a linux environment. Can be adapted to a windows environment via cygwin or powershell

assuming this openvpn start script:

openvpn --config /etc/openvpn/config --log /var/log/openvpn.log

bell.sh (run via nohup and/or put in /etc/rc.local:

-----
#!/bin/bash

MAX_BELL_TIMES=10 # 10 bells upon initialization sequence completed

while true ; do

completed=$( tail -n10 /var/log/openvpn.log | egrep 'Initialization Sequence Completed' | wc -l )
if [ $completed -ne 0 ] ; then
for belltimes in $(seq 1 ${MAX_BELL_TIMES})
do
echo -ne "\a"
done
echo -ne "\n\n\n\n\n\n\n\n\n\n\n" >> /var/log/openvpn.log
fi
sleep 10

-----

script was not tested, may contain bugs, probably not.