We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent afe0761 commit 1c4c8d2Copy full SHA for 1c4c8d2
scripts/hh-token-refresh.sh
@@ -1,7 +1,9 @@
1
#!/usr/bin/env bash
2
set -euo pipefail
3
+IFS=$'\n\t'
4
-ENV_FILE="/opt/job-search/telegram-bot/.env"
5
+ENV_FILE="${ENV_FILE:-/opt/job-search/telegram-bot/.env}"
6
+[[ -f "$ENV_FILE" ]] || { logger -t hh-token-refresh "env file not found: $ENV_FILE"; exit 3; }
7
STATE_DIR="/var/lib/hh-token"
8
CUR="${STATE_DIR}/token.json"
9
NEW="${STATE_DIR}/token.json.new"
@@ -12,7 +14,8 @@ mkdir -p "$STATE_DIR"
12
14
chmod 700 "$STATE_DIR"
13
15
16
set -a
-source "$ENV_FILE"
17
+# shellcheck source=/dev/null
18
+. "$ENV_FILE"
19
set +a
20
21
if [[ ! -f "$CUR" ]]; then
0 commit comments