Skip to content

Commit

Permalink
add a check for datadir
Browse files Browse the repository at this point in the history
  • Loading branch information
toralf committed Jun 9, 2024
1 parent 3107450 commit af680b9
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion metrics.sh
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,10 @@ set -eu
export LANG=C.utf8
export PATH=/usr/sbin:/usr/bin:/sbin/:/bin

datadir=${1:-/var/lib/node_exporter} # default at least under Gentoo Linux
datadir=${1:-/var/lib/node_exporter} # default at least under Gentoo Linux
if [[ ! -d $datadir ]]; then
exit 1
fi
NICKNAME=${2:-$(grep "^Nickname " /etc/tor/torrc 2>/dev/null | awk '{ print $2 }')} # if not given nor found then derive it from the orport
export NICKNAME

Expand Down

0 comments on commit af680b9

Please sign in to comment.