summaryrefslogtreecommitdiff
path: root/vnet/screen-shell.sh
blob: fa420b9d7bb8f7d5fb5de369df32351ff41b5b38 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#!/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 tox=$(ifaddr ep$digit):$port,bt=,xmpp=