From 3fe46ffb82826140a45e3a0f91ca5eddd5789482 Mon Sep 17 00:00:00 2001 From: bol-van Date: Sun, 22 Dec 2024 13:48:36 +0300 Subject: [PATCH] ipset: do not fail if config is absent --- ipset/def.sh | 2 +- ipset/get_config.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ipset/def.sh b/ipset/def.sh index 9c9667f..078c097 100644 --- a/ipset/def.sh +++ b/ipset/def.sh @@ -5,7 +5,7 @@ ZAPRET_RW=${ZAPRET_RW:-"$ZAPRET_BASE"} ZAPRET_CONFIG=${ZAPRET_CONFIG:-"$ZAPRET_RW/config"} IPSET_RW_DIR="$ZAPRET_RW/ipset" -. "$ZAPRET_CONFIG" +[ -f "$ZAPRET_CONFIG" ] && . "$ZAPRET_CONFIG" . "$ZAPRET_BASE/common/base.sh" [ -z "$TMPDIR" ] && TMPDIR=/tmp diff --git a/ipset/get_config.sh b/ipset/get_config.sh index f751f18..8c665a9 100755 --- a/ipset/get_config.sh +++ b/ipset/get_config.sh @@ -4,7 +4,7 @@ IPSET_DIR="$(dirname "$0")" IPSET_DIR="$(cd "$IPSET_DIR"; pwd)" -. "$IPSET_DIR/../config" +[ -f "$IPSET_DIR/../config" ] && . "$IPSET_DIR/../config" [ -z "$GETLIST" ] && GETLIST=get_ipban.sh [ -x "$IPSET_DIR/$GETLIST" ] && exec "$IPSET_DIR/$GETLIST"