diff options
-rwxr-xr-x | scripts/vyatta-vpn-op.pl | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/scripts/vyatta-vpn-op.pl b/scripts/vyatta-vpn-op.pl index bd785e2..4b519ba 100755 --- a/scripts/vyatta-vpn-op.pl +++ b/scripts/vyatta-vpn-op.pl @@ -4,9 +4,16 @@ use strict; use lib "/opt/vyatta/share/perl5/"; use Getopt::Long; -my $op; +my $op=''; GetOptions("op=s" => \$op); +if ($op eq '') { + die 'No op specified'; +} + +if ($op eq 'clear-vpn-ipsec-process') { + system '/usr/sbin/ipsec setup restart'; +} if ($op eq 'show-vpn-debug') { system '/usr/sbin/ipsec auto --status'; } @@ -14,8 +21,5 @@ if ($op eq 'show-vpn-debug-detail') { system '/usr/sbin/ipsec barf'; } -if ($op eq 'clear-vpn-ipsec-process') { - system '/usr/sbin/ipsec setup restart'; -} - +die "Unknown op: $op"; |