client-disconnect | telnet - status 2 - into an file
Posted: Mon Jul 27, 2015 12:15 pm
Hello,
i want to pipe the output of the management command "status 2" into a file when a device is disconnected
i have
in the disconnect.sh i have
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
that's all - why ? Is this a bug ?
I try with openVPN 2.2.1 (Debian Stable) and the openVPN 2.3.6
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
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
the file have the following code inside
Code: Select all
Trying 172.16.0.1... Connected to 172.16.0.1. Escape character is '^]'.
I try with openVPN 2.2.1 (Debian Stable) and the openVPN 2.3.6