mirror of
https://github.com/dashpay/dash.git
synced 2024-12-26 20:42:59 +01:00
debac13960
688f665a5e526fda0fb797bf617412fe9cbe64fd Scripts and tools & Docs: Used #!/usr/bin/env bash instead of obsolete #!/bin/bash, added linting for .sh files shebang and updated the Developer Notes. (vim88) Pull request description: As it was discussed in [#13510](https://github.com/bitcoin/bitcoin/pull/13510), it is better to use `#!/usr/bin/env bash` instead of `#!/bin/bash`. Tree-SHA512: 25f71eb9a6a0cdc91568b5c6863205c5fe095f77a69e633503a2ac7805bd9013af8538e538c0c666ce96a28e3f43ce7a8df5f08d4ff007723bb588d85674f2da
22 lines
768 B
Bash
Executable File
22 lines
768 B
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
export LC_ALL=C
|
|
set -e
|
|
|
|
# Get Tor service IP if running
|
|
if [[ "$1" == "dashd" ]]; then
|
|
# Because dashd only accept torcontrol= host as an ip only, we resolve it here and add to config
|
|
if [[ "$TOR_CONTROL_HOST" ]] && [[ "$TOR_CONTROL_PORT" ]] && [[ "$TOR_PROXY_PORT" ]]; then
|
|
TOR_IP=$(getent hosts $TOR_CONTROL_HOST | cut -d ' ' -f 1)
|
|
echo "proxy=$TOR_IP:$TOR_PROXY_PORT" >> "$HOME/.dashcore/dash.conf"
|
|
echo "Added "proxy=$TOR_IP:$TOR_PROXY_PORT" to $HOME/.dashcore/dash.conf"
|
|
echo "torcontrol=$TOR_IP:$TOR_CONTROL_PORT" >> "$HOME/.dashcore/dash.conf"
|
|
echo "Added "torcontrol=$TOR_IP:$TOR_CONTROL_PORT" to $HOME/.dashcore/dash.conf"
|
|
echo -e "\n"
|
|
else
|
|
echo "Tor control credentials not provided"
|
|
fi
|
|
fi
|
|
|
|
exec "$@"
|