Skip to content

Commit

Permalink
Consistancy check between provided torrc and SKIP_TEMPLATE (#184)
Browse files Browse the repository at this point in the history
* Improve error handling

* Linting
  • Loading branch information
thomasleplus authored Feb 6, 2025
1 parent 3ab3f91 commit cacf66f
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion tor/tor-wrapper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,20 @@ if [ -f '/etc/torrc' ]; then
fi
\cp -f '/etc/torrc' '/etc/tor/torrc'
\echo 'WARN: Found configuration file at deprecated location /etc/torrc. Please use /etc/tor/torrc instead or it will stop working in future releases of this image.'
elif [ -n "${SKIP_TEMPLATE+x}" ]; then
fi
if [ -n "${SKIP_TEMPLATE+x}" ]; then
if [ "${DEBUG}" = true ]; then
\echo "DEBUG: Skipping templating since SKIP_TEMPLATE is set."
fi
\echo "Skipping templating."
else
if [ "${DEBUG}" = true ]; then
\echo "DEBUG: Using template since SKIP_TEMPLATE is not set."
fi
if [ -f '/etc/tor/torrc' ]; then
>&2 \echo "ERROR: Cannot use both configuration template and provided torrc file. Either remove the torrc file or set SKIP_TEMPLATE to use provided torrc."
exit 1
fi
if [ -n "${SHELL_FORMAT+x}" ]; then
if [ "${DEBUG}" = true ]; then
\echo "DEBUG: Found custom Shell Format for envsubst: ${SHELL_FORMAT}"
Expand Down

0 comments on commit cacf66f

Please sign in to comment.