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