summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--scripts/vyatta-show-ipsec-status.pl2
-rwxr-xr-xscripts/vyatta-show-vpn.pl12
2 files changed, 9 insertions, 5 deletions
diff --git a/scripts/vyatta-show-ipsec-status.pl b/scripts/vyatta-show-ipsec-status.pl
index 7ae384a..1701bad 100644
--- a/scripts/vyatta-show-ipsec-status.pl
+++ b/scripts/vyatta-show-ipsec-status.pl
@@ -72,7 +72,7 @@ sub relate_intfs_with_localips {
}
}
if ($ip_found == 0) {
- print "(no IP on interface used as local-ip for any VPN peer)";
+ print "(no IP on interface statically configured as local-ip for any VPN peer)";
}
print "\n";
}
diff --git a/scripts/vyatta-show-vpn.pl b/scripts/vyatta-show-vpn.pl
index 6f896c2..f1c1078 100755
--- a/scripts/vyatta-show-vpn.pl
+++ b/scripts/vyatta-show-vpn.pl
@@ -44,10 +44,14 @@ if ($arg0 eq 'secrets') {
print "Local Peer Secret\n";
print "-------- ------- ------\n";
foreach my $line (@raw_data) {
- if ($line =~ /PSK/) {
- my ($lip, $pip, $secret) = $line =~ /^(\S+)\s+(\S+)\s+\:\s+PSK\s+(\"\S+\")/;
- printf "%-15s %-15s %s\n", $lip, $pip, $secret;
- }
+ if ($line =~ /PSK/) {
+ my ($lip, $pip, $secret) = ('', '', '');
+ ($secret) = $line =~ /.*:\s+PSK\s+(\"\S+\")/;
+ ($lip, $pip) = $line =~ /^(\S+)\s+(\S+)\s+\:\s+PSK\s+\"\S+\"/;
+ $lip = '0.0.0.0' if ! defined $lip;
+ $pip = '0.0.0.0' if ! defined $pip;
+ printf "%-15s %-15s %s\n", $lip, $pip, $secret;
+ }
}
exit 0;
}