Bob Mottram 10 years ago
parent
commit
6558b6e6bc
1 changed files with 14 additions and 13 deletions
  1. 14
    13
      src/freedombone-mesh

+ 14
- 13
src/freedombone-mesh View File

39
 TOX_PORT=33445
39
 TOX_PORT=33445
40
 TOXCORE_REPO='git://github.com/irungentoo/toxcore.git'
40
 TOXCORE_REPO='git://github.com/irungentoo/toxcore.git'
41
 TOX_BOOTSTRAP_ID_FILE=/var/lib/tox-bootstrapd/pubkey.txt
41
 TOX_BOOTSTRAP_ID_FILE=/var/lib/tox-bootstrapd/pubkey.txt
42
-QTOX_INI='~/.config/tox/qtox.ini'
42
+QTOX_INI="/home/$USER/.config/tox/qtox.ini"
43
 
43
 
44
 # client or server installations sounds odd for a mesh, but this
44
 # client or server installations sounds odd for a mesh, but this
45
 # indicates whether this is a dedicated mesh peer ("yes") or
45
 # indicates whether this is a dedicated mesh peer ("yes") or
159
 }
159
 }
160
 
160
 
161
 function run_tox {
161
 function run_tox {
162
-    if [ -f $TOXIC_PATH ]; then
162
+    echo $QTOX_INI
163
+    if [[ -f $TOXIC_PATH || -f $QTOX_INI ]]; then
163
         if [[ $SERVER_INSTALLATION == "no" ]]; then
164
         if [[ $SERVER_INSTALLATION == "no" ]]; then
164
             # update bootstrap nodes
165
             # update bootstrap nodes
165
             if [ -f $DHTNODES ]; then
166
             if [ -f $DHTNODES ]; then
200
         if [ ${#PEER_TOX_ID} -gt 30 ]; then
201
         if [ ${#PEER_TOX_ID} -gt 30 ]; then
201
             # start client and make a friend request
202
             # start client and make a friend request
202
             if [ -f $QTOX_INI ]; then
203
             if [ -f $QTOX_INI ]; then
204
+                echo 'Launch qTox'
203
                 qtox &
205
                 qtox &
204
             else
206
             else
205
 
207
 
313
 if [ ! -f $IRSSI_PATH ]; then
315
 if [ ! -f $IRSSI_PATH ]; then
314
     if [ ! -f $TOXIC_PATH ]; then
316
     if [ ! -f $TOXIC_PATH ]; then
315
         if [ -f $MUMBLE_PATH ]; then
317
         if [ -f $MUMBLE_PATH ]; then
316
-            MUMBLE_PATH &
318
+            $MUMBLE_PATH &
317
             exit 0
319
             exit 0
318
         fi
320
         fi
319
         echo 'You need irssi/mumble/toxic installed on your system'
321
         echo 'You need irssi/mumble/toxic installed on your system'
379
         echo 'Mumble may not be installed on this system'
381
         echo 'Mumble may not be installed on this system'
380
         exit 5
382
         exit 5
381
     fi
383
     fi
382
-else
383
-    if [[ $peer_index == 2 ]]; then
384
-        run_tox
385
-    else
386
-        if [ -f $IRSSI_PATH ]; then
387
-            $IRSSI_PATH -c $AVAHI_DOMAIN -p $IRC_PORT -n $USER
388
-        else
389
-            echo 'Irssi/toxic/mumble may not be installed on this system'
390
-            exit 8
391
-        fi
384
+fi
385
+
386
+if [[ $peer_index == 2 ]]; then
387
+    run_tox
388
+fi
389
+
390
+if [[ $peer_index == 3 ]]; then
391
+    if [ -f $IRSSI_PATH ]; then
392
+        $IRSSI_PATH -c $AVAHI_DOMAIN -p $IRC_PORT -n $USER
392
     fi
393
     fi
393
 fi
394
 fi
394
 
395