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