Merge pull request #4324 from MilhouseVH/le10_iptables_helper_noise

iptables: fix helper script
This commit is contained in:
Christian Hewitt 2020-04-17 06:11:46 +04:00 committed by GitHub
commit 677f569ce9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,4 +1,4 @@
#!/bin/sh - #!/bin/sh
# SPDX-License-Identifier: GPL-2.0 # SPDX-License-Identifier: GPL-2.0
# Copyright (C) 2017-present Team LibreELEC (https://libreelec.tv) # Copyright (C) 2017-present Team LibreELEC (https://libreelec.tv)
@ -17,15 +17,19 @@ check_docker() {
$SYSTEMCTL is-active --quiet $DOCKER && $SYSTEMCTL restart $DOCKER $SYSTEMCTL is-active --quiet $DOCKER && $SYSTEMCTL restart $DOCKER
} }
get_technology_config() {
$CONNMANCTL technologies | awk -v pattern="^/.*/technology/$1$" -e 'BEGIN {S=0}; /^\/.*/ {S=0}; $0 ~ pattern {S=1}; S==1 {print $0}'
}
check_tether() { check_tether() {
if [ -n "`$CONNMANCTL technologies | grep -e -A5 technology/wifi -e 'Tethering = True'`" ]; then for technology in wifi ethernet; do
TECHNOLOGY="wifi" if get_technology_config $technology | grep -q 'Tethering = True'; then
elif [ -n "`$CONNMANCTL technologies | grep -e -A5 technology/ethernet -e 'Tethering = True'`" ]; then $CONNMANCTL tether $technology off
TECHNOLOGY="ethernet"
fi
$CONNMANCTL tether $TECHNOLOGY off
sleep 1 sleep 1
$CONNMANCTL tether $TECHNOLOGY on $CONNMANCTL tether $technology on
break
fi
done
} }
flush() { flush() {