Run qtox if it exists

This commit is contained in:
Bob Mottram 2015-08-30 17:02:36 +01:00
parent 17a87bac1d
commit 84f690dbda
1 changed files with 9 additions and 3 deletions

View File

@ -39,6 +39,7 @@ PEERS_FILE=/tmp/meshpeers.txt
TOX_PORT=33445
TOXCORE_REPO='git://github.com/irungentoo/toxcore.git'
TOX_BOOTSTRAP_ID_FILE=/var/lib/tox-bootstrapd/pubkey.txt
QTOX_INI='~/.config/tox/qtox.ini'
# client or server installations sounds odd for a mesh, but this
# indicates whether this is a dedicated mesh peer ("yes") or
@ -198,13 +199,18 @@ function run_tox {
# if this is a valid ID
if [ ${#PEER_TOX_ID} -gt 30 ]; then
# start client and make a friend request
echo "n
if [ -f $QTOX_INI ]; then
qtox &
else
echo "n
/nick $USER
/add $PEER_TOX_ID
/exit
" | $TOXIC_PATH -d
# Running twice is a hack to get around buggyness in the client
$TOXIC_PATH -d
# Running twice is a hack to get around buggyness in the client
$TOXIC_PATH -d
fi
exit 0
else
# ID was invalid