mirror of
https://github.com/LibreELEC/LibreELEC.tv.git
synced 2025-08-01 15:07:49 +00:00
iptables: Fix several issues
- iptables.service: Fix flush on stop if EnviromentFile becomes unavailable - home.v*: Fix wifi tethering - iptables_helper: fix check_docker function
This commit is contained in:
parent
f7875a1f40
commit
68e038c675
@ -8,7 +8,7 @@
|
|||||||
-A INPUT -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
|
-A INPUT -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
|
||||||
-A INPUT -i tether -p udp -m conntrack --ctstate NEW -j ACCEPT
|
-A INPUT -i tether -p udp -m conntrack --ctstate NEW -j ACCEPT
|
||||||
-A INPUT -j private-subnets
|
-A INPUT -j private-subnets
|
||||||
-A FORWARD -i tether -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
|
-A FORWARD -i tether -m conntrack --ctstate NEW,RELATED,ESTABLISHED -j ACCEPT
|
||||||
-A FORWARD -o tether -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
|
-A FORWARD -o tether -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
|
||||||
-A DOCKER-USER -j private-subnets
|
-A DOCKER-USER -j private-subnets
|
||||||
-A private-subnets -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
|
-A private-subnets -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
-A INPUT -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
|
-A INPUT -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
|
||||||
-A INPUT -i tether -p udp -m conntrack --ctstate NEW -j ACCEPT
|
-A INPUT -i tether -p udp -m conntrack --ctstate NEW -j ACCEPT
|
||||||
-A INPUT -j private-subnets
|
-A INPUT -j private-subnets
|
||||||
-A FORWARD -i tether -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
|
-A FORWARD -i tether -m conntrack --ctstate NEW,RELATED,ESTABLISHED -j ACCEPT
|
||||||
-A FORWARD -o tether -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
|
-A FORWARD -o tether -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
|
||||||
-A DOCKER-USER -j private-subnets
|
-A DOCKER-USER -j private-subnets
|
||||||
-A private-subnets -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
|
-A private-subnets -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
|
||||||
|
@ -23,18 +23,19 @@ IPTABLES_CMDS="$IPTABLES4 $IPTABLES6"
|
|||||||
PUBLIC_RULES="/etc/iptables/public.v"
|
PUBLIC_RULES="/etc/iptables/public.v"
|
||||||
HOME_RULES="/etc/iptables/home.v"
|
HOME_RULES="/etc/iptables/home.v"
|
||||||
CUSTOM_RULES="/storage/.config/iptables/rules.v"
|
CUSTOM_RULES="/storage/.config/iptables/rules.v"
|
||||||
|
DOCKER="service.system.docker.service"
|
||||||
|
SYSTEMCTL="/usr/bin/systemctl"
|
||||||
|
CONNMANCTL="/usr/bin/connmanctl"
|
||||||
|
|
||||||
check_docker() {
|
check_docker() {
|
||||||
if [ "`/usr/bin/systemctl is-active docker.service`" == "active" ]; then
|
$SYSTEMCTL is-active --quiet $DOCKER && $SYSTEMCTL restart $DOCKER
|
||||||
/usr/bin/systemctl restart docker
|
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
|
|
||||||
check_tether() {
|
check_tether() {
|
||||||
if [ -n "`/usr/bin/connmanctl technologies|grep 'Tethering = True'`" ]; then
|
if [ -n "`$CONNMANCTL technologies|grep 'Tethering = True'`" ]; then
|
||||||
/usr/bin/connmanctl tether wifi off
|
$CONNMANCTL tether wifi off
|
||||||
sleep 1
|
sleep 1
|
||||||
/usr/bin/connmanctl tether wifi on
|
$CONNMANCTL tether wifi on
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
[Unit]
|
[Unit]
|
||||||
Description=IPTABLES Packet Filtering
|
Description=IPTABLES Packet Filtering
|
||||||
ConditionPathExists=/usr/lib/libreelec/iptables_helper
|
ConditionPathExists=/usr/lib/libreelec/iptables_helper
|
||||||
ConditionPathExists=/storage/.cache/services/iptables.conf
|
ConditionPathExists=|/storage/.cache/services/iptables.conf
|
||||||
Before=network.target
|
Before=network.target
|
||||||
Wants=network.target
|
Wants=network.target
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=oneshot
|
Type=oneshot
|
||||||
EnvironmentFile=/storage/.cache/services/iptables.conf
|
EnvironmentFile=-/storage/.cache/services/iptables.conf
|
||||||
ExecStart=/usr/lib/libreelec/iptables_helper enable
|
ExecStart=/usr/lib/libreelec/iptables_helper enable
|
||||||
ExecReload=/usr/lib/libreelec/iptables_helper enable
|
ExecReload=/usr/lib/libreelec/iptables_helper enable
|
||||||
ExecStop=/usr/lib/libreelec/iptables_helper disable
|
ExecStop=/usr/lib/libreelec/iptables_helper disable
|
||||||
|
Loading…
x
Reference in New Issue
Block a user