Skip to content

Commit bec394a

Browse files
committed
Fixed fw hooks pre-checks
1 parent b4ee758 commit bec394a

File tree

14 files changed

+34
-19
lines changed

14 files changed

+34
-19
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/usr/bin/with-contenv bash
2+
3+
#
4+
# Pre-checks for firewall destruction related hooks
5+
#
6+
7+
# Check if firewall rules are disabled
8+
if [ "$USE_FIREWALL" == "false" ]; then
9+
exit 0 # Don't use fw rules
10+
fi
11+
12+
# Don't run if persistent interface
13+
if [ "$PERSISTENT_INTERFACE" == "true" ]; then
14+
exit 0
15+
fi
Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
#!/usr/bin/with-contenv bash
22

33
#
4-
# Pre-checks for firewall related hooks
4+
# Pre-checks for firewall setup related hooks
55
#
66

77
# Check if firewall rules are disabled
88
if [ "$USE_FIREWALL" == "false" ]; then
9-
exit 0 # Don't use fw rules
9+
exit 0 # Don't use fw rules
1010
fi
1111

1212
# Run script only once if persistent interface
1313
# @see https://stackoverflow.com/questions/4774054/reliable-way-for-a-bash-script-to-get-the-full-path-to-itself
1414
if [ "$PERSISTENT_INTERFACE" == "true" ]; then
15-
flagFile="$(realpath $0).flag"
16-
if [ -f "$flagFile" ]; then
17-
exit 0 # Flag file exists, exit
18-
fi
19-
touch $flagFile
15+
flagFile="$(realpath $0).flag"
16+
if [ -f "$flagFile" ]; then
17+
exit 0 # Flag file exists, exit
18+
fi
19+
touch $flagFile
2020
fi

root/defaults/example/config/basic_nat/hooks/down/10-network.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/with-contenv bash
22

3-
source /app/hookBaseFirewall.sh
3+
source /app/hookBaseFirewallDestroy.sh
44

55
#
66
# Network clear

root/defaults/example/config/basic_nat/hooks/finish/10-network.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/with-contenv bash
22

3-
source /app/hookBaseFirewall.sh
3+
source /app/hookBaseFirewallDestroy.sh
44

55
#
66
# Network clear

root/defaults/example/config/basic_nat/hooks/init/10-network.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/with-contenv bash
22

3-
source /app/hookBaseFirewall.sh
3+
source /app/hookBaseFirewallSetup.sh
44

55
#
66
# Network initialization

root/defaults/example/config/basic_nat/hooks/up/10-network.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/with-contenv bash
22

3-
source /app/hookBaseFirewall.sh
3+
source /app/hookBaseFirewallSetup.sh
44

55
#
66
# Network initialization

root/defaults/example/config/basic_nat_wlp/hooks/down/10-network.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/with-contenv bash
22

3-
source /app/hookBaseFirewall.sh
3+
source /app/hookBaseFirewallDestroy.sh
44

55
#
66
# Network clear

root/defaults/example/config/basic_nat_wlp/hooks/finish/10-network.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/with-contenv bash
22

3-
source /app/hookBaseFirewall.sh
3+
source /app/hookBaseFirewallDestroy.sh
44

55
#
66
# Network clear

root/defaults/example/config/basic_nat_wlp/hooks/init/10-network.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/with-contenv bash
22

3-
source /app/hookBaseFirewall.sh
3+
source /app/hookBaseFirewallSetup.sh
44

55
#
66
# Network initialization

root/defaults/example/config/basic_nat_wlp/hooks/up/10-network.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/with-contenv bash
22

3-
source /app/hookBaseFirewall.sh
3+
source /app/hookBaseFirewallSetup.sh
44

55
#
66
# Network initialization

0 commit comments

Comments
 (0)