aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfbt <fbt@fleshless.org>2019-11-26 01:46:00 +0300
committerfbt <fbt@fleshless.org>2019-11-26 01:46:00 +0300
commit7858829ec464bcb5ee229f272dacd48063ece608 (patch)
tree839f2dfc4f73cbf0753f68b98347910d266da051
parentbfbd899554051b185c58b424dfef200202f9a728 (diff)
downloadufw-tools-7858829ec464bcb5ee229f272dacd48063ece608.tar.gz
ufw-tools-7858829ec464bcb5ee229f272dacd48063ece608.zip
support setting the secret in env vars
Signed-off-by: fbt <fbt@fleshless.org>
-rwxr-xr-xufw3
1 files changed, 3 insertions, 0 deletions
diff --git a/ufw b/ufw
index 425ec0b..4472ea5 100755
--- a/ufw
+++ b/ufw
@@ -56,6 +56,7 @@ usage() {
Environment variables:
UFW_CFG_FILE # Config file to read, defaults to \$XDG_CONFIG_DIR/ufw
+ UFW_SECRET # Your API secret
EOF
}
@@ -359,6 +360,8 @@ main() {
cfg_url_regex='^[A-Za-z]([A-Za-z0-9+.-]+)?://.+'
cfg_file=${UFW_CFG_FILE:-"$XDG_CONFIG_DIR/ufw"}
+ [[ $UFW_SECRET ]] && secret=$UFW_SECRET
+
[[ $1 ]] || { usage; return 1; }
if [[ -f "$cfg_file" ]]; then