summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Mangin <thomas.mangin@exa.net.uk>2020-03-07 23:32:27 +0000
committerGitHub <noreply@github.com>2020-03-07 23:32:27 +0000
commit29db0d04ceec3ef4a869d8809f06b89051a3d430 (patch)
tree43a2a320b5358460d950fb116f9cc751bd2fa0da
parent2c1d2a03e950112bff995e6070020a7f74912b35 (diff)
parent77b4dc894551a6ff52d825799ea75ec0f3603074 (diff)
downloadvyatta-op-29db0d04ceec3ef4a869d8809f06b89051a3d430.tar.gz
vyatta-op-29db0d04ceec3ef4a869d8809f06b89051a3d430.zip
Merge branch 'current' into current
-rw-r--r--functions/interpreter/vyatta-common14
-rwxr-xr-xscripts/ping39
-rw-r--r--templates/ping/node.tag/node.tag/node.def4
3 files changed, 18 insertions, 39 deletions
diff --git a/functions/interpreter/vyatta-common b/functions/interpreter/vyatta-common
index c6e645f..f08d983 100644
--- a/functions/interpreter/vyatta-common
+++ b/functions/interpreter/vyatta-common
@@ -33,11 +33,11 @@ get_prefix_filtered_list ()
eval "olist=( \"\${$2[@]}\" )"
local idx=0
for elem in "${olist[@]}"; do
- local sub=${elem#$pfx}
+ local sub="${elem#$pfx}"
if [[ "$elem" == "$sub" ]] && [[ -n "$pfx" ]]; then
continue
fi
- eval "$3[$idx]=\"$elem\""
+ eval "$3[$idx]=\$elem"
(( idx++ ))
done
}
@@ -59,21 +59,21 @@ get_prefix_filtered_list2 ()
for (( orig_idx = 0; orig_idx < orig_len; orig_idx++ )); do
eval "local elem=\${$2[$orig_idx]}"
eval "local elem2=\${$4[$orig_idx]}"
- local sub=${elem#$pfx}
+ local sub="${elem#$pfx}"
if [[ "$elem" == "$sub" ]] && [[ -n "$pfx" ]]; then
continue
fi
- eval "$3[$idx]=\"$elem\""
- eval "$5[$idx]=\"$elem2\""
+ eval "$3[$idx]=\$elem"
+ eval "$5[$idx]=\$elem2"
(( idx++ ))
done
}
is_elem_of () {
- local elem=$1
+ local elem="$1"
local -a olist
eval "olist=( \"\${$2[@]}\" )"
- for e in ${olist[*]}; do
+ for e in "${olist[@]}"; do
if [[ "$e" == "$elem" ]]; then
return 0
fi
diff --git a/scripts/ping b/scripts/ping
index 60430d6..e41e334 100755
--- a/scripts/ping
+++ b/scripts/ping
@@ -1,39 +1,18 @@
#! /usr/bin/env python3
-# Copyright 2020 VyOS maintainers and contributors <maintainers@vyos.io>
+# Copyright (C) 2020 VyOS maintainers and contributors
#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 or later as
+# published by the Free Software Foundation.
#
-# This library is distributed in the hope that it will be useful,
+# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library. If not, see <http://www.gnu.org/licenses/>.
-#
-# Syntax
-# ping HOST
-# [ audible ]
-# [ adaptive ]
-# [ allow-broadcast]
-# [ count REQUESTS ]
-# [ mark N ]
-# [ flow LABEL ]
-# [ flood ]
-# [ interval ]
-# [ pattern PATTERN ]
-# [ timestamp ]
-# [ tos VALUE ]
-# [ quiet ]
-# [ bypass-routing ]
-# [ size SIZE ]
-# [ ttl TTL ]
-# [ vrf table ]
-# [ verbose ]
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
import os
import sys
diff --git a/templates/ping/node.tag/node.tag/node.def b/templates/ping/node.tag/node.tag/node.def
index cca366b..a231d68 100644
--- a/templates/ping/node.tag/node.tag/node.def
+++ b/templates/ping/node.tag/node.tag/node.def
@@ -1,3 +1,3 @@
help: Ping options
-allowed: /opt/vyatta/bin/ping --get-options "${COMP_WORDS[@]}"
-run: /opt/vyatta/bin/ping ${@:2}
+allowed: ${vyatta_bindir}/ping --get-options "${COMP_WORDS[@]}"
+run: ${vyatta_bindir}/ping ${@:2}