Page 1 of 1

client-disconnect | telnet - status 2 - into an file

Posted: Mon Jul 27, 2015 12:15 pm
by goofy79
Hello,

i want to pipe the output of the management command "status 2" into a file when a device is disconnected
i have

Code: Select all

script-security 2
client-disconnect /etc/openvpn/scripts/disconnect.sh
in the disconnect.sh i have

Code: Select all

#!/bin/bash

result=$(( echo -n -e "status 2\n"; sleep 2; echo -n -e "quit\n" ) | telnet 172.16.0.1 2727)
echo $result > /tmp/vpn-status
if i start the script in the bash i get the Output in the file - if the script was called in the client-disconnect script.
the file have the following code inside

Code: Select all

Trying 172.16.0.1... Connected to 172.16.0.1. Escape character is '^]'.
that's all - why ? Is this a bug ?

I try with openVPN 2.2.1 (Debian Stable) and the openVPN 2.3.6

Re: client-disconnect | telnet - status 2 - into an file

Posted: Thu Aug 06, 2015 9:01 am
by goofy79
Hello,

can somebody test this or reconstruct this too ?

Re: client-disconnect | telnet - status 2 - into an file

Posted: Wed Sep 09, 2015 9:37 am
by goofy79
Please - can somebody try this ?
Is this a Bug or is there any workaround ?

Many Thanks