aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/tools/wg-quick.bash
diff options
context:
space:
mode:
Diffstat (limited to 'src/tools/wg-quick.bash')
-rwxr-xr-xsrc/tools/wg-quick.bash4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/tools/wg-quick.bash b/src/tools/wg-quick.bash
index ccf27a9..bb7325c 100755
--- a/src/tools/wg-quick.bash
+++ b/src/tools/wg-quick.bash
@@ -79,7 +79,9 @@ add_if() {
}
del_if() {
- DEFAULT_TABLE=$(( $(wg show "$INTERFACE" fwmark) ))
+ local fwmark="$(wg show "$INTERFACE" fwmark)"
+ DEFAULT_TABLE=0
+ [[ $fwmark != off ]] && DEFAULT_TABLE=$(( $fwmark ))
if [[ $DEFAULT_TABLE -ne 0 ]]; then
while [[ -n $(ip -4 rule show table $DEFAULT_TABLE) ]]; do
cmd ip -4 rule delete table $DEFAULT_TABLE