Skip to content

Commit c7c738b

Browse files
committed
Fix unbound DOMAIN variable crash on --status/--manage, bump to v1.2
- Move global variable initialization before arg parser so --status, --manage, and other standalone commands don't crash with set -u - Bump VERSION from 1.1 to 1.2
1 parent 123c8aa commit c7c738b

1 file changed

Lines changed: 13 additions & 10 deletions

File tree

dnstm-setup.sh

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
set -euo pipefail
1212

13-
VERSION="1.1"
13+
VERSION="1.2"
1414
TOTAL_STEPS=12
1515

1616
# ─── Colors & Formatting ───────────────────────────────────────────────────────
@@ -1774,6 +1774,18 @@ do_manage() {
17741774
trap - INT
17751775
}
17761776

1777+
# ─── Global Variables (must be set before arg parser since --status/--manage use them) ───
1778+
1779+
DOMAIN=""
1780+
SERVER_IP=""
1781+
DNSTT_PUBKEY=""
1782+
SSH_USER=""
1783+
SSH_PASS=""
1784+
SOCKS_USER=""
1785+
SOCKS_PASS=""
1786+
SOCKS_AUTH=false
1787+
TUNNELS_CHANGED=false
1788+
17771789
# ─── Parse Arguments ────────────────────────────────────────────────────────────
17781790

17791791
ADD_DOMAIN_MODE=false
@@ -1858,15 +1870,6 @@ fi
18581870

18591871
# ─── Variables (populated during setup) ─────────────────────────────────────────
18601872

1861-
DOMAIN=""
1862-
SERVER_IP=""
1863-
DNSTT_PUBKEY=""
1864-
SSH_USER=""
1865-
SSH_PASS=""
1866-
SOCKS_USER=""
1867-
SOCKS_PASS=""
1868-
SOCKS_AUTH=false
1869-
TUNNELS_CHANGED=false
18701873
SSH_SETUP_DONE=false
18711874

18721875
# ─── STEP 1: Pre-flight Checks ─────────────────────────────────────────────────

0 commit comments

Comments
 (0)