is this legacy? Don't even remember
Signed-off-by: fbt <fbt@fleshless.org>
This commit is contained in:
@@ -18,7 +18,7 @@ Call ufw -h for help.
|
||||
|
||||
Dependencies: curl, jq
|
||||
|
||||
The config goes into `$XDG_CONFIG_DIR/ufw`.
|
||||
The config goes into `$XDG_CONFIG_HOME/ufw`.
|
||||
|
||||
ufwd
|
||||
----
|
||||
|
||||
@@ -55,7 +55,7 @@ usage() {
|
||||
cfg_service_url
|
||||
|
||||
Environment variables:
|
||||
UFW_CFG_FILE # Config file to read, defaults to \$XDG_CONFIG_DIR/ufw
|
||||
UFW_CFG_FILE # Config file to read, defaults to \$XDG_CONFIG_HOME/ufw
|
||||
UFW_SECRET # Your API secret
|
||||
UFW_TMP_DIR
|
||||
UFW_URL
|
||||
@@ -332,12 +332,12 @@ main() {
|
||||
XDG_RUNTIME_DIR="/run/user/$UID"
|
||||
fi
|
||||
|
||||
if ! [[ "$XDG_CONFIG_DIR" ]]; then
|
||||
XDG_CONFIG_DIR="$HOME/.config"
|
||||
if ! [[ "$XDG_CONFIG_HOME" ]]; then
|
||||
XDG_CONFIG_HOME="$HOME/.config"
|
||||
fi
|
||||
|
||||
cfg_url_regex='^[A-Za-z]([A-Za-z0-9+.-]+)?://.+'
|
||||
cfg_file=${UFW_CFG_FILE:-"$XDG_CONFIG_DIR/ufw"}
|
||||
cfg_file=${UFW_CFG_FILE:-"$XDG_CONFIG_HOME/ufw"}
|
||||
|
||||
[[ $UFW_SECRET ]] && secret=$UFW_SECRET
|
||||
[[ $UFW_TMP_DIR ]] && cfg_tmp_dir=$UFW_TMP_DIR
|
||||
@@ -353,7 +353,7 @@ main() {
|
||||
fi
|
||||
|
||||
# Defaults
|
||||
: ${cfg_file:="$XDG_CONFIG_DIR/ufw"}
|
||||
: ${cfg_file:="$XDG_CONFIG_HOME/ufw"}
|
||||
: ${cfg_tmp_dir:="$XDG_RUNTIME_DIR/ufw"}
|
||||
: ${cfg_service_url:='https://8fw.me'}
|
||||
: ${cfg_max_filesize:='200M'}
|
||||
|
||||
Reference in New Issue
Block a user