Bläddra i källkod

Port has no quotes

Bob Mottram 9 år sedan
förälder
incheckning
3faa143b69
1 ändrade filer med 19 tillägg och 7 borttagningar
  1. 19
    7
      src/freedombone-mesh-install

+ 19
- 7
src/freedombone-mesh-install Visa fil

@@ -38,8 +38,6 @@ export TEXTDOMAINDIR="/usr/share/locale"
38 38
 # for mesh installs
39 39
 TRACKER_PORT=6969
40 40
 
41
-ZERONET_PORT=15441
42
-
43 41
 WIFI_CHANNEL=2
44 42
 WIFI_INTERFACE='wlan0'
45 43
 
@@ -71,6 +69,7 @@ TOX_NODES=
71 69
 # To avoid confusions these are obtained from the main project file
72 70
 ZERONET_REPO=
73 71
 ZERONET_COMMIT=
72
+ZERONET_PORT=
74 73
 
75 74
 function show_help {
76 75
     echo ''
@@ -449,9 +448,9 @@ function mesh_tox_node {
449 448
     fi
450 449
 
451 450
     if [ -f /usr/local/bin/${PROJECT_NAME} ]; then
452
-        TOX_PORT_MAIN=$(cat /usr/local/bin/${PROJECT_NAME} | grep "TOX_PORT=" | head -n 1 | awk -F "'" '{print $2}')
451
+        TOX_PORT_MAIN=$(cat /usr/local/bin/${PROJECT_NAME} | grep "TOX_PORT=" | head -n 1 | awk -F '=' '{print $2}')
453 452
     else
454
-        TOX_PORT_MAIN=$(cat /usr/bin/${PROJECT_NAME} | grep "TOX_PORT=" | head -n 1 | awk -F "'" '{print $2}')      
453
+        TOX_PORT_MAIN=$(cat /usr/bin/${PROJECT_NAME} | grep "TOX_PORT=" | head -n 1 | awk -F '=' '{print $2}')      
455 454
     fi
456 455
     if [ ${#TOX_PORT_MAIN} -gt 2 ]; then
457 456
         TOX_PORT=$TOX_PORT_MAIN
@@ -615,6 +614,19 @@ function mesh_zeronet {
615 614
         echo $'No Tox commit was specified'
616 615
         exit 37046
617 616
     fi  
617
+
618
+    if [ -f /usr/local/bin/${PROJECT_NAME} ]; then
619
+        ZERONET_PORT_MAIN=$(cat /usr/local/bin/${PROJECT_NAME} | grep "ZERONET_PORT=" | head -n 1 | awk -F '=' '{print $2}')
620
+    else
621
+        ZERONET_PORT_MAIN=$(cat /usr/bin/${PROJECT_NAME} | grep "ZERONET_PORT=" | head -n 1 | awk -F '=' '{print $2}')      
622
+    fi
623
+    if [ ${#ZERONET_PORT_MAIN} -gt 1 ]; then
624
+        ZERONET_PORT=$ZERONET_PORT_MAIN
625
+    fi
626
+    if [ ! $ZERONET_PORT ]; then
627
+        echo $'No zeronet port was specified'
628
+        exit 67433
629
+    fi  
618 630
     
619 631
     $CHROOT_PREFIX apt-get -y install python python-msgpack python-gevent
620 632
     $CHROOT_PREFIX apt-get -y install python-pip bittornado
@@ -696,9 +708,9 @@ function mesh_batman_client {
696 708
         if [ ! -f /usr/bin/toxic ]; then
697 709
             $CHROOT_PREFIX sudo apt-get -y install toxic
698 710
             echo "n
699
-    /nick $USER
700
-    /exit
701
-    " | ${rootdir}/usr/bin/toxic -d
711
+                        /nick $USER
712
+                        /exit
713
+                        " | ${rootdir}/usr/bin/toxic -d
702 714
         fi
703 715
     fi
704 716