diff options
-rw-r--r-- | Makefile.am | 3 | ||||
-rwxr-xr-x | functions/allowed/hosts | 24 | ||||
-rw-r--r-- | templates/ping/node.tag/node.def | 3 | ||||
-rw-r--r-- | templates/ping6/node.tag/node.def | 3 | ||||
-rw-r--r-- | templates/set/date/ntp/node.tag/node.def | 2 | ||||
-rw-r--r-- | templates/show/host/lookup/node.tag/node.def | 9 | ||||
-rw-r--r-- | templates/show/ntp/node.tag/node.def | 3 | ||||
-rw-r--r-- | templates/telnet/node.tag/node.def | 9 | ||||
-rw-r--r-- | templates/traceroute/node.tag/node.def | 3 | ||||
-rw-r--r-- | templates/traceroute6/node.tag/node.def | 3 |
10 files changed, 20 insertions, 42 deletions
diff --git a/Makefile.am b/Makefile.am index a2ae002..2bc3a15 100644 --- a/Makefile.am +++ b/Makefile.am @@ -8,9 +8,6 @@ bin_sudo_usersdir = $(bindir)/sudo-users funcdir = $(datadir)/vyatta-op/functions func_DATA = functions/tech-support -alloweddir = $(datadir)/vyatta-op/functions/allowed -allowed_DATA = functions/allowed/hosts - bin_SCRIPTS = scripts/vyatta-show-interfaces bin_SCRIPTS += scripts/vyatta-show-interfaces.pl bin_SCRIPTS += scripts/vyatta-show-version diff --git a/functions/allowed/hosts b/functions/allowed/hosts deleted file mode 100755 index 912a9ea..0000000 --- a/functions/allowed/hosts +++ /dev/null @@ -1,24 +0,0 @@ -# -# utility function used by node.tag/node.def to list "allowed" -# or expanded hosts/address -# -declare -a _vyatta_hosts -declare -a _vyatta_symbolic_hosts=( '<hostname>' '<x.x.x.x>' ) -declare -i _vyatta_hostfile_lastmod=0 -declare _vyatta_hostfile_sed='s/#.*//; ; s/^[^ \t]\+[ \t]\+//; s/[ \t]\+/\n/g; /^$/d' - -function vyatta-allowed-hosts () -{ - : ${HOSTFILE:=/etc/hosts} - local -i curmod=$(stat --printf %Y $HOSTFILE) - - if [ $curmod -ne $_vyatta_hostfile_lastmod ] ; then - _vyatta_hosts=( $(sed "$_vyatta_hostfile_sed" $HOSTFILE) ) - _vyatta_hostfile_lastmod=$curmod - fi - printf "%s\n" ${_vyatta_symbolic_hosts[@]} # ${_vyatta_hosts[@]} $* # commenting this untill ipv6 is supported -} - -### Local Variables: -### mode: shell-script -### End: diff --git a/templates/ping/node.tag/node.def b/templates/ping/node.tag/node.def index 9f58702..6a05e3b 100644 --- a/templates/ping/node.tag/node.def +++ b/templates/ping/node.tag/node.def @@ -3,7 +3,6 @@ # help: Send ICMP echo request to specified <hostname|IPv4 address> -allowed: - vyatta-allowed-hosts +allowed: echo "<hostname> <x.x.x.x>" run: /bin/ping $2 diff --git a/templates/ping6/node.tag/node.def b/templates/ping6/node.tag/node.def index 7dc822c..f6bade7 100644 --- a/templates/ping6/node.tag/node.def +++ b/templates/ping6/node.tag/node.def @@ -3,7 +3,6 @@ # help: Send IPv6 ICMP echo request to specified <hostname|IPv6 address> -allowed: - vyatta-allowed-hosts +allowed: echo "<hostname> <x:x:x:x:x>" run: /bin/ping6 $2 diff --git a/templates/set/date/ntp/node.tag/node.def b/templates/set/date/ntp/node.tag/node.def index 2bb348c..71f2697 100644 --- a/templates/set/date/ntp/node.tag/node.def +++ b/templates/set/date/ntp/node.tag/node.def @@ -1,3 +1,3 @@ help: Set system date and time with given NTP server -allowed: vyatta-allowed-hosts ntp.vyatta.com +allowed: echo "<hostname> <x.x.x.x> ntp.vyatta.com" run: sudo ntpdate ${4:-ntp.vyatta.com} diff --git a/templates/show/host/lookup/node.tag/node.def b/templates/show/host/lookup/node.tag/node.def index 29bf5a7..ba5a4ad 100644 --- a/templates/show/host/lookup/node.tag/node.def +++ b/templates/show/host/lookup/node.tag/node.def @@ -1,3 +1,8 @@ -help: Lookup host information for specified <hostname|IPv4 address> -allowed: vyatta-allowed-hosts +help: Lookup host information for specified name or address +allowed: echo "<hostname> <x.x.x.x> <y:y:y:y:y>" +comp_help: Possible completions + <hostname> host name (static or DNS) + <x.x.x.x> IPv4 address + <y:y:y:y:y:y> IPv6 address + run: /usr/bin/host $4 diff --git a/templates/show/ntp/node.tag/node.def b/templates/show/ntp/node.tag/node.def index d1f00d7..2710671 100644 --- a/templates/show/ntp/node.tag/node.def +++ b/templates/show/ntp/node.tag/node.def @@ -1,4 +1,3 @@ help: Show date and time of specified NTP server -allowed: vyatta-allowed-hosts ntp.vyatta.com ; - awk '/^server/ { print $2 }' /etc/ntp.conf +allowed: echo ntp.vyatta.com; awk '/^server/ { print $2 }' /etc/ntp.conf run: /usr/sbin/ntpdate -q ${3:-ntp.vyatta.com} diff --git a/templates/telnet/node.tag/node.def b/templates/telnet/node.tag/node.def index 643b7cb..590c587 100644 --- a/templates/telnet/node.tag/node.def +++ b/templates/telnet/node.tag/node.def @@ -1,5 +1,10 @@ -help: Telnet to <hostname|IPv4 address> -allowed: vyatta-allowed-hosts +help: Telnet to host +allowed: echo "<hostname> <x.x.x.x> <y:y:y:y:y>" +comp_help: Possible completions + <hostname> host name (static or DNS) + <x.x.x.x> IPv4 address + <y:y:y:y:y:y> IPv6 address + run: if [ -x /usr/bin/telnet ] ; then /usr/bin/$* elif [ -x /bin/busybox ] ; then diff --git a/templates/traceroute/node.tag/node.def b/templates/traceroute/node.tag/node.def index cf60ec4..b079582 100644 --- a/templates/traceroute/node.tag/node.def +++ b/templates/traceroute/node.tag/node.def @@ -3,8 +3,7 @@ # help: Track network path to specified <hostname|IPv4 address> -allowed: - vyatta-allowed-hosts +allowed: echo "<hostname> <x.x.x.x>" run: if /opt/vyatta/sbin/vyatta-validate-type.pl -q ipv4 $2 diff --git a/templates/traceroute6/node.tag/node.def b/templates/traceroute6/node.tag/node.def index 5148e6d..7d91a39 100644 --- a/templates/traceroute6/node.tag/node.def +++ b/templates/traceroute6/node.tag/node.def @@ -3,8 +3,7 @@ # help: Track network path to specified <hostname|IPv6 address> -allowed: - vyatta-allowed-hosts +allowed: echo "<hostname> <x:x:x:x:x>" run: if /opt/vyatta/sbin/vyatta-validate-type.pl -q ipv6 $2 |