#!/bin/sh

# Enable SOCKS on network interfaces with static IPs.
static_ips=$(awk '/ address/ {print $2}' /etc/network/interfaces)
for static_ip in $static_ips
do
    if ! grep -q "SocksPort $static_ip:9050" /etc/tor/torrc ; then
        echo "SocksPort $static_ip:9050" >> /etc/tor/torrc
    fi
done
