From 65622a733df80ecee2192f3cd5758a27e4324b3b Mon Sep 17 00:00:00 2001 From: Nataliia Solomko Date: Tue, 10 Sep 2024 16:00:13 +0300 Subject: op-mode: T6694: Move some op-mode commands in the "execute" family MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 'force netns' — move to 'execute shell netns'. 'force vrf'— move to 'execute shell vrf'. 'force owping' — move to 'execute owping'. 'force twping' — move to 'execute twping'. 'monitor bandwidth-test' — move to 'execute bandwidth-test`. 'telnet' — move to 'execute telnet' --- src/op_mode/execute_bandwidth_test.sh | 33 +++++++++++++++++++++++++++++++++ src/op_mode/monitor_bandwidth_test.sh | 33 --------------------------------- 2 files changed, 33 insertions(+), 33 deletions(-) create mode 100755 src/op_mode/execute_bandwidth_test.sh delete mode 100755 src/op_mode/monitor_bandwidth_test.sh (limited to 'src') diff --git a/src/op_mode/execute_bandwidth_test.sh b/src/op_mode/execute_bandwidth_test.sh new file mode 100755 index 000000000..a6ad0b42c --- /dev/null +++ b/src/op_mode/execute_bandwidth_test.sh @@ -0,0 +1,33 @@ +#!/bin/sh +# +# Copyright (C) 2020 VyOS maintainers and contributors +# +# 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 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 General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +if ipaddrcheck --is-ipv6 $1; then + # Set address family to IPv6 when an IPv6 address was specified + OPT="-V" +elif [[ $(dig $1 AAAA +short | grep -v '\.$' | wc -l) -gt 0 ]]; then + # CNAME is also part of the dig answer thus we must remove any + # CNAME response and only shot the AAAA response(s), this is done + # by grep -v '\.$' + + # Set address family to IPv6 when FQDN has at least one AAAA record + OPT="-V" +else + # It's not IPv6, no option needed + OPT="" +fi + +/usr/bin/iperf $OPT -c $1 $2 + diff --git a/src/op_mode/monitor_bandwidth_test.sh b/src/op_mode/monitor_bandwidth_test.sh deleted file mode 100755 index a6ad0b42c..000000000 --- a/src/op_mode/monitor_bandwidth_test.sh +++ /dev/null @@ -1,33 +0,0 @@ -#!/bin/sh -# -# Copyright (C) 2020 VyOS maintainers and contributors -# -# 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 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 General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - -if ipaddrcheck --is-ipv6 $1; then - # Set address family to IPv6 when an IPv6 address was specified - OPT="-V" -elif [[ $(dig $1 AAAA +short | grep -v '\.$' | wc -l) -gt 0 ]]; then - # CNAME is also part of the dig answer thus we must remove any - # CNAME response and only shot the AAAA response(s), this is done - # by grep -v '\.$' - - # Set address family to IPv6 when FQDN has at least one AAAA record - OPT="-V" -else - # It's not IPv6, no option needed - OPT="" -fi - -/usr/bin/iperf $OPT -c $1 $2 - -- cgit v1.2.3