tor-proxy/tor.sh

11 lines
242 B
Bash
Executable File

#!/bin/sh
HOSTNAME=$1
IP_ADDR=$(nslookup $HOSTNAME | awk '/^Address: / { print $2 }' | tail -n1 | sed -e 's/[[:space:]]//g')
sed -i "s/$HOSTNAME/$IP_ADDR/g" /etc/tor/torrc
echo "*** Service Hostname: $(/usr/local/bin/svc-hostname)" &
tor