Browse Source

Port has no quotes

Bob Mottram 9 years ago
parent
commit
3faa143b69
1 changed files with 19 additions and 7 deletions
  1. 19
    7
      src/freedombone-mesh-install

+ 19
- 7
src/freedombone-mesh-install View File

38
 # for mesh installs
38
 # for mesh installs
39
 TRACKER_PORT=6969
39
 TRACKER_PORT=6969
40
 
40
 
41
-ZERONET_PORT=15441
42
-
43
 WIFI_CHANNEL=2
41
 WIFI_CHANNEL=2
44
 WIFI_INTERFACE='wlan0'
42
 WIFI_INTERFACE='wlan0'
45
 
43
 
71
 # To avoid confusions these are obtained from the main project file
69
 # To avoid confusions these are obtained from the main project file
72
 ZERONET_REPO=
70
 ZERONET_REPO=
73
 ZERONET_COMMIT=
71
 ZERONET_COMMIT=
72
+ZERONET_PORT=
74
 
73
 
75
 function show_help {
74
 function show_help {
76
     echo ''
75
     echo ''
449
     fi
448
     fi
450
 
449
 
451
     if [ -f /usr/local/bin/${PROJECT_NAME} ]; then
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
     else
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
     fi
454
     fi
456
     if [ ${#TOX_PORT_MAIN} -gt 2 ]; then
455
     if [ ${#TOX_PORT_MAIN} -gt 2 ]; then
457
         TOX_PORT=$TOX_PORT_MAIN
456
         TOX_PORT=$TOX_PORT_MAIN
615
         echo $'No Tox commit was specified'
614
         echo $'No Tox commit was specified'
616
         exit 37046
615
         exit 37046
617
     fi  
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
     $CHROOT_PREFIX apt-get -y install python python-msgpack python-gevent
631
     $CHROOT_PREFIX apt-get -y install python python-msgpack python-gevent
620
     $CHROOT_PREFIX apt-get -y install python-pip bittornado
632
     $CHROOT_PREFIX apt-get -y install python-pip bittornado
696
         if [ ! -f /usr/bin/toxic ]; then
708
         if [ ! -f /usr/bin/toxic ]; then
697
             $CHROOT_PREFIX sudo apt-get -y install toxic
709
             $CHROOT_PREFIX sudo apt-get -y install toxic
698
             echo "n
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
         fi
714
         fi
703
     fi
715
     fi
704
 
716