duckdns misc

This commit is contained in:
2025-07-05 10:23:59 +08:00
parent e0fbdf852e
commit dd339f2939
2 changed files with 5 additions and 3 deletions

View File

@@ -4,7 +4,7 @@
thisdir="$( dirname "$(readlink -e -- "${BASH_SOURCE[0]}")")" thisdir="$( dirname "$(readlink -e -- "${BASH_SOURCE[0]}")")"
cp -f .env.example .env cp -f "$thisdir/.env.example" "$thisdir/.env"
cat <<EOF | sudo tee /etc/cron.d/duckdns && crontab -u "$(whoami)" /etc/cron.d/duckdns cat <<EOF | sudo tee /etc/cron.d/duckdns && crontab -u "$(whoami)" /etc/cron.d/duckdns
# ------------- Minute (0 - 59) # ------------- Minute (0 - 59)

View File

@@ -1,12 +1,14 @@
#!/bin/bash #!/bin/bash
# shellcheck disable=SC1091 # shellcheck disable=SC1091
[ ! -f .env ] && { thisdir="$( dirname "$(readlink -e -- "${BASH_SOURCE[0]}")")"
[ ! -f "$thisdir/.env" ] && {
echo "ERROR: .env not exists" echo "ERROR: .env not exists"
exit 1 exit 1
} }
source .env source "$thisdir/.env"
[ -z "$DUCK_TOKEN" ] && { [ -z "$DUCK_TOKEN" ] && {
echo "ERROR: env var DUCK_TOKEN not specified" echo "ERROR: env var DUCK_TOKEN not specified"