1ACTMP=$1
2shift
3exe=$1
4shift
5PORT=14981
6while netstat -antup 2>&1 | grep $PORT ; do PORT=$(( $PORT + 1 )) ; done
7$exe port:$PORT cachedir=$ACTMP logdir:$ACTMP foreground:0 pidfile=$ACTMP/_pid
8
9finish_acng() {
10  kill $(cat $ACTMP/_pid)
11}
12
13export http_proxy=http://localhost:$PORT
14export https_proxy=http://localhost:$PORT
15