A better way
Signed-off-by: fbt <fbt@fleshless.org>
This commit is contained in:
parent
03e0fda896
commit
4e1d3a7bcd
2
ufw
2
ufw
|
@ -357,10 +357,10 @@ main() {
|
||||||
fi
|
fi
|
||||||
|
|
||||||
cfg_url_regex='^[A-Za-z]([A-Za-z0-9+.-]+)?://.+'
|
cfg_url_regex='^[A-Za-z]([A-Za-z0-9+.-]+)?://.+'
|
||||||
|
cfg_file=${UFW_CFG_FILE:-"$XDG_CONFIG_DIR/ufw"}
|
||||||
|
|
||||||
[[ $1 ]] || { usage; return 1; }
|
[[ $1 ]] || { usage; return 1; }
|
||||||
|
|
||||||
[[ $UFW_CFG_FILE ]] && cfg_file=$UFW_CFG_FILE
|
|
||||||
if [[ -f "$cfg_file" ]]; then
|
if [[ -f "$cfg_file" ]]; then
|
||||||
if ! source "$cfg_file"; then
|
if ! source "$cfg_file"; then
|
||||||
printf 'Failed to source configuration file: %s\n' "$cfg_file"
|
printf 'Failed to source configuration file: %s\n' "$cfg_file"
|
||||||
|
|
Loading…
Reference in New Issue
Block a user