19 lines
439 B
Bash
19 lines
439 B
Bash
#!/bin/bash
|
|
|
|
echo '[+] Starting tor'
|
|
|
|
cat > /etc/tor/torrc << EOF
|
|
DataDirectory /tmp/tor
|
|
HiddenServiceDir /web/
|
|
Log notice stdout
|
|
EOF
|
|
|
|
if [[ -n "${PRIVATE_KEY}" && -n "${REDIRECT}" ]]; then
|
|
echo "[+] Starting the listener at port ${LISTEN_PORT:-80}, redirecting to ${REDIRECT}"
|
|
echo "${PRIVATE_KEY}" > /web/private_key
|
|
cat >> /etc/tor/torrc << EOF
|
|
HiddenServicePort ${LISTEN_PORT:-80} ${REDIRECT}
|
|
EOF
|
|
fi
|
|
|
|
tor -f /etc/tor/torrc
|