To make things ultra simple, set the tox nick automatically

This commit is contained in:
Bob Mottram 2015-08-26 21:12:18 +01:00
parent 4c40c05ba6
commit d89b387635
1 changed files with 6 additions and 4 deletions

View File

@ -148,9 +148,10 @@ if [ ! -f $MUMBLE_PATH ]; then
fi fi
lstox -f dht > /tmp/dht lstox -f dht > /tmp/dht
sudo cp /tmp/dht $DHTNODES sudo cp /tmp/dht $DHTNODES
PEER_TOX_ID=$(lstox -p $AVAHI_DOMAIN | head -n 1 | awk -F ' ' '{print $2}') PEER_TOX_ID=$(lstox | grep $AVAHI_DOMAIN | head -n 1 | awk -F ' ' '{print $2}')
if [ ${#PEER_TOX_ID} -gt 30 ]; then if [ ${#PEER_TOX_ID} -gt 30 ]; then
echo "/add $PEER_TOX_ID echo "/nick $USER
/add $PEER_TOX_ID
" | $TOXIC_PATH -d " | $TOXIC_PATH -d
exit 0 exit 0
else else
@ -208,9 +209,10 @@ else
fi fi
lstox -f dht > /tmp/dht lstox -f dht > /tmp/dht
sudo cp /tmp/dht $DHTNODES sudo cp /tmp/dht $DHTNODES
PEER_TOX_ID=$(lstox -p $AVAHI_DOMAIN | head -n 1 | awk -F ' ' '{print $2}') PEER_TOX_ID=$(lstox | grep $AVAHI_DOMAIN | head -n 1 | awk -F ' ' '{print $2}')
if [ ${#PEER_TOX_ID} -gt 30 ]; then if [ ${#PEER_TOX_ID} -gt 30 ]; then
echo "/add $PEER_TOX_ID echo "/nick $USER
/add $PEER_TOX_ID
" | $TOXIC_PATH -d " | $TOXIC_PATH -d
else else
echo "Tox ID for $AVAHI_DOMAIN was not found" echo "Tox ID for $AVAHI_DOMAIN was not found"