summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorMarat Nepomnyashy <marat@vyatta.com>2008-02-22 16:15:51 -0800
committerMarat Nepomnyashy <marat@vyatta.com>2008-02-22 16:15:51 -0800
commita4f68f371730e3d55e72ece0532635aaf8553763 (patch)
tree831fa62ea2be043561f59c1f3b8e66b38c4810bd /scripts
parent36b18f78e0a142fb5d2bfed34af89f0001ec8005 (diff)
downloadvyatta-op-vpn-a4f68f371730e3d55e72ece0532635aaf8553763.tar.gz
vyatta-op-vpn-a4f68f371730e3d55e72ece0532635aaf8553763.zip
Fixed-up operator commands 'clear vpn ipsec-process' and 'show vpn debug detail' so that they no longer require sudo password.
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/vyatta-show-vpn-debug.pl3
-rwxr-xr-xscripts/vyatta-vpn-op.pl21
2 files changed, 21 insertions, 3 deletions
diff --git a/scripts/vyatta-show-vpn-debug.pl b/scripts/vyatta-show-vpn-debug.pl
deleted file mode 100755
index 3a419a7..0000000
--- a/scripts/vyatta-show-vpn-debug.pl
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/usr/bin/perl
-
-system '/usr/sbin/ipsec auto --status'
diff --git a/scripts/vyatta-vpn-op.pl b/scripts/vyatta-vpn-op.pl
new file mode 100755
index 0000000..bd785e2
--- /dev/null
+++ b/scripts/vyatta-vpn-op.pl
@@ -0,0 +1,21 @@
+#!/usr/bin/perl -w
+
+use strict;
+use lib "/opt/vyatta/share/perl5/";
+
+use Getopt::Long;
+my $op;
+GetOptions("op=s" => \$op);
+
+if ($op eq 'show-vpn-debug') {
+ system '/usr/sbin/ipsec auto --status';
+}
+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';
+}
+
+