diff options
-rw-r--r-- | debian/control | 4 | ||||
-rwxr-xr-x | debian/rules | 6 | ||||
-rwxr-xr-x | functions/tech-support | 2 | ||||
-rw-r--r-- | scripts/vyatta-op-dns-forwarding.pl | 4 | ||||
-rw-r--r-- | scripts/vyatta-op-dynamic-dns.pl | 4 | ||||
-rwxr-xr-x | scripts/vyatta-show-bonding.pl | 15 | ||||
-rwxr-xr-x | scripts/vyatta-show-interfaces.pl | 17 | ||||
-rw-r--r-- | templates/release/dhcp/interface/node.tag/node.def | 2 | ||||
-rw-r--r-- | templates/renew/dhcp/interface/node.tag/node.def | 2 | ||||
-rw-r--r-- | templates/show/tcp/all/node.def | 2 | ||||
-rw-r--r-- | templates/show/tcp/node.def | 2 | ||||
-rw-r--r-- | templates/show/tcp/numeric/node.def | 2 | ||||
-rw-r--r-- | templates/show/udp/node.def | 2 | ||||
-rw-r--r-- | templates/show/udp/numeric/node.def | 2 |
14 files changed, 40 insertions, 26 deletions
diff --git a/debian/control b/debian/control index 4cf7a5f..80e26d6 100644 --- a/debian/control +++ b/debian/control @@ -20,9 +20,9 @@ Depends: sed (>= 4.1.5), vyatta-bash | bash (>= 3.1), less, libio-prompt-perl, - at + at, + net-tools Suggests: util-linux (>= 2.13-5), - net-tools, ncurses-bin (>= 5.5-5), Description: bash operational command completion Vyatta operational command bash completion script and base templates diff --git a/debian/rules b/debian/rules index 4db6686..3277be8 100755 --- a/debian/rules +++ b/debian/rules @@ -70,7 +70,11 @@ binary-indep: build install dh_compress dh_fixperms dh_installdeb - dh_gencontrol + if [ -f "../.VYATTA_DEV_BUILD" ]; then \ + dh_gencontrol -- -v999.dev; \ + else \ + dh_gencontrol; \ + fi dh_md5sums dh_builddeb diff --git a/functions/tech-support b/functions/tech-support index 01adf11..c8386a5 100755 --- a/functions/tech-support +++ b/functions/tech-support @@ -56,7 +56,7 @@ export PATH=/sbin:/usr/sbin:$PATH header Current time date -header OFR Version and Package Changes +header Vyatta Version and Package Changes show version all header Installed Packages diff --git a/scripts/vyatta-op-dns-forwarding.pl b/scripts/vyatta-op-dns-forwarding.pl index bac1df3..5209e3e 100644 --- a/scripts/vyatta-op-dns-forwarding.pl +++ b/scripts/vyatta-op-dns-forwarding.pl @@ -25,7 +25,7 @@ use lib "/opt/vyatta/share/perl5/"; use Getopt::Long; -use VyattaConfig; +use Vyatta::Config; use strict; use warnings; @@ -89,7 +89,7 @@ sub print_stats { } sub get_dns_nameservers { - my $vyatta_config = new VyattaConfig; + my $vyatta_config = new Vyatta::Config; $vyatta_config->setLevel("service dns forwarding"); $vyatta_config->{_active_dir_base} = "/opt/vyatta/config/active/"; diff --git a/scripts/vyatta-op-dynamic-dns.pl b/scripts/vyatta-op-dynamic-dns.pl index 66e7b73..d1197c2 100644 --- a/scripts/vyatta-op-dynamic-dns.pl +++ b/scripts/vyatta-op-dynamic-dns.pl @@ -25,7 +25,7 @@ use lib "/opt/vyatta/share/perl5/"; use Getopt::Long; -use VyattaConfig; +use Vyatta::Config; use strict; use warnings; @@ -79,7 +79,7 @@ sub print_ddns_stats { sub get_ddns_interfaces { - my $vyatta_config = new VyattaConfig; + my $vyatta_config = new Vyatta::Config; $vyatta_config->setLevel("service dns dynamic"); $vyatta_config->{_active_dir_base} = "/opt/vyatta/config/active/"; my @ddns_interfaces = $vyatta_config->listOrigNodes("interface"); diff --git a/scripts/vyatta-show-bonding.pl b/scripts/vyatta-show-bonding.pl index 8a0daee..5b0a314 100755 --- a/scripts/vyatta-show-bonding.pl +++ b/scripts/vyatta-show-bonding.pl @@ -66,14 +66,25 @@ sub get_state_link { return ( $state, $link ); } +my @modes = ( "round-robin", + "active-backup", + "xor-hash", + "broadcast", + "802.3ad", + "transmit-load-balance", + "adaptive-load-balance" +); + sub show_brief { my @interfaces = @_; - my $format = "%-12s %-10s %-8s %-6s %s\n"; + my $format = "%-12s %-22s %-8s %-6s %s\n"; printf $format, 'Interface', 'Mode', 'State', 'Link', 'Slaves'; foreach my $intf (sort @interfaces) { my $mode = get_sysfs_value( $intf, "bonding/mode" ); - $mode =~ s/ [0-9]+$//; + my ( $name, $num ) = split (/ /, $mode); + $mode = $modes[$num] ? $modes[$num] : $name; + my ( $state, $link ) = get_state_link($intf); my $slaves = get_sysfs_value( $intf, "bonding/slaves" ); printf $format, $intf, $mode, $state, $link, diff --git a/scripts/vyatta-show-interfaces.pl b/scripts/vyatta-show-interfaces.pl index a776d65..02ad8e0 100755 --- a/scripts/vyatta-show-interfaces.pl +++ b/scripts/vyatta-show-interfaces.pl @@ -24,7 +24,8 @@ # use lib "/opt/vyatta/share/perl5/"; -use VyattaConfig; +use Vyatta::Config; +use Vyatta::Misc; use Getopt::Long; use POSIX; use NetAddr::IP; @@ -93,7 +94,7 @@ sub get_intf_description { if (!defined $intf_type) { return ""; } - my $config = new VyattaConfig; + my $config = new Vyatta::Config; my $path; if ($intf =~ m/([a-zA-Z]+\d+)\.(\d+)/) { $path = "interfaces $intf_type $1 vif $2"; @@ -109,18 +110,6 @@ sub get_intf_description { } } -sub get_sysfs_value { - my ($intf, $name) = @_; - - open (my $statf, '<', "/sys/class/net/$intf/$name") - or die "Can't open statistics file /sys/class/net/$intf/$name"; - - my $value = <$statf>; - chomp $value if defined $value; - close $statf; - return $value; -} - sub get_intf_stats { my $intf = shift; diff --git a/templates/release/dhcp/interface/node.tag/node.def b/templates/release/dhcp/interface/node.tag/node.def index 85773b6..834e682 100644 --- a/templates/release/dhcp/interface/node.tag/node.def +++ b/templates/release/dhcp/interface/node.tag/node.def @@ -1,7 +1,7 @@ help: Release DHCP IP address lease for specified interface allowed: local -a array ; - array=( /var/lib/dhcp3/eth* /var/lib/dhcp3/br* ) ; + array=( /var/lib/dhcp3/eth* /var/lib/dhcp3/br* /var/lib/dhcp3/bond* ) ; echo -n ${array[@]##*/} run: diff --git a/templates/renew/dhcp/interface/node.tag/node.def b/templates/renew/dhcp/interface/node.tag/node.def index 9e6c037..84e4cc0 100644 --- a/templates/renew/dhcp/interface/node.tag/node.def +++ b/templates/renew/dhcp/interface/node.tag/node.def @@ -1,7 +1,7 @@ help: Renew DHCP IP address lease for specified interface allowed: local -a array ; - array=( /var/lib/dhcp3/eth* /var/lib/dhcp3/br* ) ; + array=( /var/lib/dhcp3/eth* /var/lib/dhcp3/br* /var/lib/dhcp3/bond* ) ; echo -n ${array[@]##*/} run: diff --git a/templates/show/tcp/all/node.def b/templates/show/tcp/all/node.def new file mode 100644 index 0000000..6aa1cae --- /dev/null +++ b/templates/show/tcp/all/node.def @@ -0,0 +1,2 @@ +help: show all TCP connections +run: /sbin/ss -t -a diff --git a/templates/show/tcp/node.def b/templates/show/tcp/node.def new file mode 100644 index 0000000..8b6c99b --- /dev/null +++ b/templates/show/tcp/node.def @@ -0,0 +1,2 @@ +help: show TCP connection information +run: /sbin/ss -t -r diff --git a/templates/show/tcp/numeric/node.def b/templates/show/tcp/numeric/node.def new file mode 100644 index 0000000..7df9efe --- /dev/null +++ b/templates/show/tcp/numeric/node.def @@ -0,0 +1,2 @@ +help: show TCP connection without resolving names +run: /sbin/ss -t -n diff --git a/templates/show/udp/node.def b/templates/show/udp/node.def new file mode 100644 index 0000000..ef9e55f --- /dev/null +++ b/templates/show/udp/node.def @@ -0,0 +1,2 @@ +help: show UDP socket information +run: /sbin/ss -u -a -r diff --git a/templates/show/udp/numeric/node.def b/templates/show/udp/numeric/node.def new file mode 100644 index 0000000..cb43a91 --- /dev/null +++ b/templates/show/udp/numeric/node.def @@ -0,0 +1,2 @@ +help: show UDP socket information without resolving names +run: /sbin/ss -u -a -n |