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
lstox -f dht > /tmp/dht
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
echo "/add $PEER_TOX_ID
echo "/nick $USER
/add $PEER_TOX_ID
" | $TOXIC_PATH -d
exit 0
else
@ -208,9 +209,10 @@ else
fi
lstox -f dht > /tmp/dht
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
echo "/add $PEER_TOX_ID
echo "/nick $USER
/add $PEER_TOX_ID
" | $TOXIC_PATH -d
else
echo "Tox ID for $AVAHI_DOMAIN was not found"