from my perl script i have
Code: Select all
my $openvpn = "/usr/sbin/openvpn";
my %servers = ("usa" => "/etc/openvpn/ustcp.conf",
"uk" => "/etc/openvpn/uktcp.conf");
my $cmdStr = $openvpn . " " . $servers{$serverToStart} . " |";
open(STDIN, $cmdStr);
while( <> ) { print $_ }
I can see the output on my terminal, put the ouput never gets piped through my perl script
this code works fine if i use another program, for example tcpdump
In my final script i want to have something like:
-i issue a command from wherever (terminal/3rd party program) that will start a script
-if openvpn isnt running then a second(main script) starts in deamon mode
-this script then checks my main script to see which server openvpn is connected to
-if the server that its connected to is the same as the one i want to connect to then it sends a connected msg back to the calling script
-else it disconnects openvpn, and reconnects to new server