From 39c42e76dce4a653b788ce0a9a445a00f47c5e09 Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Tue, 26 Feb 2008 14:40:17 -0800 Subject: add command to show end of log file Fixes: https://bugzilla.vyatta.com/show_bug.cgi?id=728 New commands: show log tail == tail -f /var/log/messages show log tail N == tail -n N /var/log/messages --- templates/show/log/tail/node.def | 2 ++ templates/show/log/tail/node.tag/node.def | 3 +++ 2 files changed, 5 insertions(+) create mode 100644 templates/show/log/tail/node.def create mode 100644 templates/show/log/tail/node.tag/node.def (limited to 'templates') diff --git a/templates/show/log/tail/node.def b/templates/show/log/tail/node.def new file mode 100644 index 0000000..65bea1c --- /dev/null +++ b/templates/show/log/tail/node.def @@ -0,0 +1,2 @@ +help: Show last lines of messages file +run: tail -f /var/log/messages diff --git a/templates/show/log/tail/node.tag/node.def b/templates/show/log/tail/node.tag/node.def new file mode 100644 index 0000000..00de686 --- /dev/null +++ b/templates/show/log/tail/node.tag/node.def @@ -0,0 +1,3 @@ +help: Show last changes to messages +allowed: echo -n '' +run: tail -n "$4" /var/log/messages -- cgit v1.2.3 From 7d6f0458f50d781d04e6dfe79dbbabbc7f4f3084 Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Tue, 26 Feb 2008 14:43:36 -0800 Subject: bridge status commands don't need sudo Commands like "brctl show" don't need sudo. --- templates/show/bridge/node.def | 2 +- templates/show/bridge/node.tag/macs/node.def | 2 +- templates/show/bridge/node.tag/node.def | 2 +- templates/show/bridge/node.tag/spanning-tree/node.def | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) (limited to 'templates') diff --git a/templates/show/bridge/node.def b/templates/show/bridge/node.def index 45761f1..69121f6 100644 --- a/templates/show/bridge/node.def +++ b/templates/show/bridge/node.def @@ -1,2 +1,2 @@ help: "Show bridging information" -run: sudo brctl show +run: brctl show diff --git a/templates/show/bridge/node.tag/macs/node.def b/templates/show/bridge/node.tag/macs/node.def index c16fcb5..cbf77da 100644 --- a/templates/show/bridge/node.tag/macs/node.def +++ b/templates/show/bridge/node.tag/macs/node.def @@ -1,2 +1,2 @@ help: Show bridge MAC table -run: sudo brctl showmacs $3 +run: brctl showmacs $3 diff --git a/templates/show/bridge/node.tag/node.def b/templates/show/bridge/node.tag/node.def index d439a03..770165e 100644 --- a/templates/show/bridge/node.tag/node.def +++ b/templates/show/bridge/node.tag/node.def @@ -2,4 +2,4 @@ help: Show bridge information for a given bridge allowed: local -a array ; array=( /sys/class/net/br* ) ; echo -n ${array[@]##*/} -run: sudo brctl show $3 +run: brctl show $3 diff --git a/templates/show/bridge/node.tag/spanning-tree/node.def b/templates/show/bridge/node.tag/spanning-tree/node.def index 8840ee6..33d16d9 100644 --- a/templates/show/bridge/node.tag/spanning-tree/node.def +++ b/templates/show/bridge/node.tag/spanning-tree/node.def @@ -1,2 +1,2 @@ help: Show bridge spanning tree information -run: sudo brctl showstp $3 +run: brctl showstp $3 -- cgit v1.2.3 From af91e353109647aac21ac723c3ce9111cf582f3f Mon Sep 17 00:00:00 2001 From: Stig Thormodsrud Date: Tue, 26 Feb 2008 16:21:48 -0800 Subject: Fix operator permissions for "clear arp" and "clear ip route cache". --- debian/vyatta-op.postinst.in | 2 +- templates/clear/arp/address/node.tag/node.def | 2 +- templates/clear/arp/interface/node.tag/node.def | 2 +- templates/clear/ip/route/cache/node.def | 2 +- templates/clear/ip/route/cache/node.tag/node.def | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) (limited to 'templates') diff --git a/debian/vyatta-op.postinst.in b/debian/vyatta-op.postinst.in index 4f0b3b4..bdb6bcd 100644 --- a/debian/vyatta-op.postinst.in +++ b/debian/vyatta-op.postinst.in @@ -8,4 +8,4 @@ bindir=@bindir@ ln -sf /usr/sbin/ethtool ${bindir}/sudo-users/ethtool ln -sf /usr/sbin/dmidecode ${bindir}/sudo-users/dmidecode ln -sf /sbin/iptables ${bindir}/sudo-users/iptables - +ln -sf /bin/ip ${bindir}/sudo-users/ip diff --git a/templates/clear/arp/address/node.tag/node.def b/templates/clear/arp/address/node.tag/node.def index a25ad1f..1cfd2a3 100644 --- a/templates/clear/arp/address/node.tag/node.def +++ b/templates/clear/arp/address/node.tag/node.def @@ -1,3 +1,3 @@ help: Clear ARP cache for address allowed: echo -n '' -run: sudo ip neigh flush to $4 +run: sudo ${vyatta_bindir}/sudo-users/ip neigh flush to $4 diff --git a/templates/clear/arp/interface/node.tag/node.def b/templates/clear/arp/interface/node.tag/node.def index d948ba2..eb0ec26 100644 --- a/templates/clear/arp/interface/node.tag/node.def +++ b/templates/clear/arp/interface/node.tag/node.def @@ -2,4 +2,4 @@ help: Clear ARP cache for interface allowed: local -a array ; array=( /sys/class/net/{eth,vmnet}* ) ; echo -n ${array[@]##*/} -run: sudo ip neigh flush dev $4 +run: sudo ${vyatta_bindir}/sudo-users/ip neigh flush dev $4 diff --git a/templates/clear/ip/route/cache/node.def b/templates/clear/ip/route/cache/node.def index 3ec559d..9648cef 100644 --- a/templates/clear/ip/route/cache/node.def +++ b/templates/clear/ip/route/cache/node.def @@ -1,2 +1,2 @@ help: Flush the kernel route cache -run: sudo ip route flush cache +run: sudo ${vyatta_bindir}/sudo-users/ip route flush cache diff --git a/templates/clear/ip/route/cache/node.tag/node.def b/templates/clear/ip/route/cache/node.tag/node.def index 288fcbc..37fc458 100644 --- a/templates/clear/ip/route/cache/node.tag/node.def +++ b/templates/clear/ip/route/cache/node.tag/node.def @@ -1,3 +1,3 @@ help: Flush the kernel route cache for a given route allowed: echo -n '' -run: sudo ip route flush cache $5 +run: sudo ${vyatta_bindir}/sudo-users/ip route flush cache $5 -- cgit v1.2.3 From 93fe2569aedb2b60604b9ef77edd40aa2af17f93 Mon Sep 17 00:00:00 2001 From: Stig Thormodsrud Date: Tue, 26 Feb 2008 18:00:41 -0800 Subject: Fix operator permissions for "clear interface counters" and "clear dhcp client process" --- debian/vyatta-op.postinst.in | 2 ++ templates/clear/dhcp/client/process/node.def | 2 +- templates/clear/interfaces/bridge/counters/node.def | 2 +- templates/clear/interfaces/bridge/node.tag/counters/node.def | 2 +- templates/clear/interfaces/counters/node.def | 2 +- templates/clear/interfaces/ethernet/counters/node.def | 2 +- templates/clear/interfaces/ethernet/node.tag/counters/node.def | 2 +- templates/clear/interfaces/loopback/counters/node.def | 2 +- templates/clear/interfaces/loopback/node.tag/counters/node.def | 2 +- templates/clear/interfaces/tunnel/counters/node.def | 2 +- templates/clear/interfaces/tunnel/node.tag/counters/node.def | 2 +- 11 files changed, 12 insertions(+), 10 deletions(-) (limited to 'templates') diff --git a/debian/vyatta-op.postinst.in b/debian/vyatta-op.postinst.in index bdb6bcd..ac650fc 100644 --- a/debian/vyatta-op.postinst.in +++ b/debian/vyatta-op.postinst.in @@ -9,3 +9,5 @@ ln -sf /usr/sbin/ethtool ${bindir}/sudo-users/ethtool ln -sf /usr/sbin/dmidecode ${bindir}/sudo-users/dmidecode ln -sf /sbin/iptables ${bindir}/sudo-users/iptables ln -sf /bin/ip ${bindir}/sudo-users/ip +ln -sf /opt/vyatta/bin/vyatta-show-interfaces.pl ${bindir}/sudo-users/vyatta-show-interfaces.pl +ln -sf /opt/vyatta/sbin/vyatta-interfaces.pl ${bindir}/sudo-users/vyatta-interfaces.pl diff --git a/templates/clear/dhcp/client/process/node.def b/templates/clear/dhcp/client/process/node.def index 565e702..50e52ff 100644 --- a/templates/clear/dhcp/client/process/node.def +++ b/templates/clear/dhcp/client/process/node.def @@ -1,2 +1,2 @@ help: Restart the dhcp client process -run: sudo /opt/vyatta/sbin/vyatta-interfaces.pl --restart-dhclient +run: sudo ${vyatta_bindir}/sudo-users/vyatta-interfaces.pl --restart-dhclient diff --git a/templates/clear/interfaces/bridge/counters/node.def b/templates/clear/interfaces/bridge/counters/node.def index ad13229..1a93d5b 100644 --- a/templates/clear/interfaces/bridge/counters/node.def +++ b/templates/clear/interfaces/bridge/counters/node.def @@ -1,2 +1,2 @@ help: Clear all bridge interface counters -run: sudo ${vyatta_bindir}/vyatta-show-interfaces.pl --action=clear --intf-type=$3 +run: sudo ${vyatta_bindir}/sudo-users/vyatta-show-interfaces.pl --action=clear --intf-type=$3 diff --git a/templates/clear/interfaces/bridge/node.tag/counters/node.def b/templates/clear/interfaces/bridge/node.tag/counters/node.def index 985e9ab..086f966 100644 --- a/templates/clear/interfaces/bridge/node.tag/counters/node.def +++ b/templates/clear/interfaces/bridge/node.tag/counters/node.def @@ -1,2 +1,2 @@ help: Clear interface counters for a given interface -run: sudo ${vyatta_bindir}/vyatta-show-interfaces.pl --action=clear --intf=$4 +run: sudo ${vyatta_bindir}/sudo-users/vyatta-show-interfaces.pl --action=clear --intf=$4 diff --git a/templates/clear/interfaces/counters/node.def b/templates/clear/interfaces/counters/node.def index 252251a..a29bcbc 100644 --- a/templates/clear/interfaces/counters/node.def +++ b/templates/clear/interfaces/counters/node.def @@ -1,2 +1,2 @@ help: Clear interface counters for all interfaces -run: sudo ${vyatta_bindir}/vyatta-show-interfaces.pl --action=clear +run: sudo ${vyatta_bindir}/sudo-users/vyatta-show-interfaces.pl --action=clear diff --git a/templates/clear/interfaces/ethernet/counters/node.def b/templates/clear/interfaces/ethernet/counters/node.def index e05e218..e7a5d6a 100644 --- a/templates/clear/interfaces/ethernet/counters/node.def +++ b/templates/clear/interfaces/ethernet/counters/node.def @@ -1,2 +1,2 @@ help: Clear all Ethernet interface counters -run: sudo ${vyatta_bindir}/vyatta-show-interfaces.pl --action=clear --intf-type=$3 +run: sudo ${vyatta_bindir}/sudo-users/vyatta-show-interfaces.pl --action=clear --intf-type=$3 diff --git a/templates/clear/interfaces/ethernet/node.tag/counters/node.def b/templates/clear/interfaces/ethernet/node.tag/counters/node.def index 985e9ab..086f966 100644 --- a/templates/clear/interfaces/ethernet/node.tag/counters/node.def +++ b/templates/clear/interfaces/ethernet/node.tag/counters/node.def @@ -1,2 +1,2 @@ help: Clear interface counters for a given interface -run: sudo ${vyatta_bindir}/vyatta-show-interfaces.pl --action=clear --intf=$4 +run: sudo ${vyatta_bindir}/sudo-users/vyatta-show-interfaces.pl --action=clear --intf=$4 diff --git a/templates/clear/interfaces/loopback/counters/node.def b/templates/clear/interfaces/loopback/counters/node.def index 5ebcd3d..37761b6 100644 --- a/templates/clear/interfaces/loopback/counters/node.def +++ b/templates/clear/interfaces/loopback/counters/node.def @@ -1,2 +1,2 @@ help: Clear all loopback interface counters -run: sudo ${vyatta_bindir}/vyatta-show-interfaces.pl --action=clear --intf-type=$3 +run: sudo ${vyatta_bindir}/sudo-users/vyatta-show-interfaces.pl --action=clear --intf-type=$3 diff --git a/templates/clear/interfaces/loopback/node.tag/counters/node.def b/templates/clear/interfaces/loopback/node.tag/counters/node.def index 985e9ab..086f966 100644 --- a/templates/clear/interfaces/loopback/node.tag/counters/node.def +++ b/templates/clear/interfaces/loopback/node.tag/counters/node.def @@ -1,2 +1,2 @@ help: Clear interface counters for a given interface -run: sudo ${vyatta_bindir}/vyatta-show-interfaces.pl --action=clear --intf=$4 +run: sudo ${vyatta_bindir}/sudo-users/vyatta-show-interfaces.pl --action=clear --intf=$4 diff --git a/templates/clear/interfaces/tunnel/counters/node.def b/templates/clear/interfaces/tunnel/counters/node.def index c856a04..8816a99 100644 --- a/templates/clear/interfaces/tunnel/counters/node.def +++ b/templates/clear/interfaces/tunnel/counters/node.def @@ -1,2 +1,2 @@ help: Clear all tunnel interface counters -run: sudo ${vyatta_bindir}/vyatta-show-interfaces.pl --action=clear --intf-type=$3 +run: sudo ${vyatta_bindir}/sudo-users/vyatta-show-interfaces.pl --action=clear --intf-type=$3 diff --git a/templates/clear/interfaces/tunnel/node.tag/counters/node.def b/templates/clear/interfaces/tunnel/node.tag/counters/node.def index 985e9ab..086f966 100644 --- a/templates/clear/interfaces/tunnel/node.tag/counters/node.def +++ b/templates/clear/interfaces/tunnel/node.tag/counters/node.def @@ -1,2 +1,2 @@ help: Clear interface counters for a given interface -run: sudo ${vyatta_bindir}/vyatta-show-interfaces.pl --action=clear --intf=$4 +run: sudo ${vyatta_bindir}/sudo-users/vyatta-show-interfaces.pl --action=clear --intf=$4 -- cgit v1.2.3 From 543600c241dc59f8a6d7a52ca8f0115c552a3757 Mon Sep 17 00:00:00 2001 From: Stig Thormodsrud Date: Tue, 26 Feb 2008 18:32:30 -0800 Subject: Add quotes to user entered parameters --- templates/clear/interfaces/bridge/counters/node.def | 2 +- templates/clear/interfaces/bridge/node.tag/counters/node.def | 2 +- templates/clear/interfaces/ethernet/counters/node.def | 2 +- templates/clear/interfaces/ethernet/node.tag/counters/node.def | 2 +- templates/clear/interfaces/loopback/counters/node.def | 2 +- templates/clear/interfaces/loopback/node.tag/counters/node.def | 2 +- templates/clear/interfaces/tunnel/counters/node.def | 2 +- templates/clear/interfaces/tunnel/node.tag/counters/node.def | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) (limited to 'templates') diff --git a/templates/clear/interfaces/bridge/counters/node.def b/templates/clear/interfaces/bridge/counters/node.def index 1a93d5b..226394d 100644 --- a/templates/clear/interfaces/bridge/counters/node.def +++ b/templates/clear/interfaces/bridge/counters/node.def @@ -1,2 +1,2 @@ help: Clear all bridge interface counters -run: sudo ${vyatta_bindir}/sudo-users/vyatta-show-interfaces.pl --action=clear --intf-type=$3 +run: sudo ${vyatta_bindir}/sudo-users/vyatta-show-interfaces.pl --action=clear --intf-type="$3" diff --git a/templates/clear/interfaces/bridge/node.tag/counters/node.def b/templates/clear/interfaces/bridge/node.tag/counters/node.def index 086f966..ba3199b 100644 --- a/templates/clear/interfaces/bridge/node.tag/counters/node.def +++ b/templates/clear/interfaces/bridge/node.tag/counters/node.def @@ -1,2 +1,2 @@ help: Clear interface counters for a given interface -run: sudo ${vyatta_bindir}/sudo-users/vyatta-show-interfaces.pl --action=clear --intf=$4 +run: sudo ${vyatta_bindir}/sudo-users/vyatta-show-interfaces.pl --action=clear --intf="$4" diff --git a/templates/clear/interfaces/ethernet/counters/node.def b/templates/clear/interfaces/ethernet/counters/node.def index e7a5d6a..85a02d5 100644 --- a/templates/clear/interfaces/ethernet/counters/node.def +++ b/templates/clear/interfaces/ethernet/counters/node.def @@ -1,2 +1,2 @@ help: Clear all Ethernet interface counters -run: sudo ${vyatta_bindir}/sudo-users/vyatta-show-interfaces.pl --action=clear --intf-type=$3 +run: sudo ${vyatta_bindir}/sudo-users/vyatta-show-interfaces.pl --action=clear --intf-type="$3" diff --git a/templates/clear/interfaces/ethernet/node.tag/counters/node.def b/templates/clear/interfaces/ethernet/node.tag/counters/node.def index 086f966..ba3199b 100644 --- a/templates/clear/interfaces/ethernet/node.tag/counters/node.def +++ b/templates/clear/interfaces/ethernet/node.tag/counters/node.def @@ -1,2 +1,2 @@ help: Clear interface counters for a given interface -run: sudo ${vyatta_bindir}/sudo-users/vyatta-show-interfaces.pl --action=clear --intf=$4 +run: sudo ${vyatta_bindir}/sudo-users/vyatta-show-interfaces.pl --action=clear --intf="$4" diff --git a/templates/clear/interfaces/loopback/counters/node.def b/templates/clear/interfaces/loopback/counters/node.def index 37761b6..eefdac4 100644 --- a/templates/clear/interfaces/loopback/counters/node.def +++ b/templates/clear/interfaces/loopback/counters/node.def @@ -1,2 +1,2 @@ help: Clear all loopback interface counters -run: sudo ${vyatta_bindir}/sudo-users/vyatta-show-interfaces.pl --action=clear --intf-type=$3 +run: sudo ${vyatta_bindir}/sudo-users/vyatta-show-interfaces.pl --action=clear --intf-type="$3" diff --git a/templates/clear/interfaces/loopback/node.tag/counters/node.def b/templates/clear/interfaces/loopback/node.tag/counters/node.def index 086f966..ba3199b 100644 --- a/templates/clear/interfaces/loopback/node.tag/counters/node.def +++ b/templates/clear/interfaces/loopback/node.tag/counters/node.def @@ -1,2 +1,2 @@ help: Clear interface counters for a given interface -run: sudo ${vyatta_bindir}/sudo-users/vyatta-show-interfaces.pl --action=clear --intf=$4 +run: sudo ${vyatta_bindir}/sudo-users/vyatta-show-interfaces.pl --action=clear --intf="$4" diff --git a/templates/clear/interfaces/tunnel/counters/node.def b/templates/clear/interfaces/tunnel/counters/node.def index 8816a99..7ef46d2 100644 --- a/templates/clear/interfaces/tunnel/counters/node.def +++ b/templates/clear/interfaces/tunnel/counters/node.def @@ -1,2 +1,2 @@ help: Clear all tunnel interface counters -run: sudo ${vyatta_bindir}/sudo-users/vyatta-show-interfaces.pl --action=clear --intf-type=$3 +run: sudo ${vyatta_bindir}/sudo-users/vyatta-show-interfaces.pl --action=clear --intf-type="$3" diff --git a/templates/clear/interfaces/tunnel/node.tag/counters/node.def b/templates/clear/interfaces/tunnel/node.tag/counters/node.def index 086f966..ba3199b 100644 --- a/templates/clear/interfaces/tunnel/node.tag/counters/node.def +++ b/templates/clear/interfaces/tunnel/node.tag/counters/node.def @@ -1,2 +1,2 @@ help: Clear interface counters for a given interface -run: sudo ${vyatta_bindir}/sudo-users/vyatta-show-interfaces.pl --action=clear --intf=$4 +run: sudo ${vyatta_bindir}/sudo-users/vyatta-show-interfaces.pl --action=clear --intf="$4" -- cgit v1.2.3