#!/bin/sh ifaddr() { ip -o address show dev $1 | sed -n 's#.* inet \([^ /]*\).*#\1#p' } touch window-count count=$(cat window-count) count=${count:-(-1)} count=$(( $count + 1 )) echo $count > window-count digit=$(printf '%X' $count) cd ep$digit port=$(( 33400 + $count )) pwd ../dhtd --noavahi tox=$(ifaddr ep$digit):$port,bt=,xmpp= -v TCP,Onion