From 3faa143b6931120ccc05d1648db491d554a573e3 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Tue, 12 Apr 2016 10:06:58 +0100 Subject: [PATCH] Port has no quotes --- src/freedombone-mesh-install | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/src/freedombone-mesh-install b/src/freedombone-mesh-install index 2de87473..67a04517 100755 --- a/src/freedombone-mesh-install +++ b/src/freedombone-mesh-install @@ -38,8 +38,6 @@ export TEXTDOMAINDIR="/usr/share/locale" # for mesh installs TRACKER_PORT=6969 -ZERONET_PORT=15441 - WIFI_CHANNEL=2 WIFI_INTERFACE='wlan0' @@ -71,6 +69,7 @@ TOX_NODES= # To avoid confusions these are obtained from the main project file ZERONET_REPO= ZERONET_COMMIT= +ZERONET_PORT= function show_help { echo '' @@ -449,9 +448,9 @@ function mesh_tox_node { fi if [ -f /usr/local/bin/${PROJECT_NAME} ]; then - TOX_PORT_MAIN=$(cat /usr/local/bin/${PROJECT_NAME} | grep "TOX_PORT=" | head -n 1 | awk -F "'" '{print $2}') + TOX_PORT_MAIN=$(cat /usr/local/bin/${PROJECT_NAME} | grep "TOX_PORT=" | head -n 1 | awk -F '=' '{print $2}') else - TOX_PORT_MAIN=$(cat /usr/bin/${PROJECT_NAME} | grep "TOX_PORT=" | head -n 1 | awk -F "'" '{print $2}') + TOX_PORT_MAIN=$(cat /usr/bin/${PROJECT_NAME} | grep "TOX_PORT=" | head -n 1 | awk -F '=' '{print $2}') fi if [ ${#TOX_PORT_MAIN} -gt 2 ]; then TOX_PORT=$TOX_PORT_MAIN @@ -615,6 +614,19 @@ function mesh_zeronet { echo $'No Tox commit was specified' exit 37046 fi + + if [ -f /usr/local/bin/${PROJECT_NAME} ]; then + ZERONET_PORT_MAIN=$(cat /usr/local/bin/${PROJECT_NAME} | grep "ZERONET_PORT=" | head -n 1 | awk -F '=' '{print $2}') + else + ZERONET_PORT_MAIN=$(cat /usr/bin/${PROJECT_NAME} | grep "ZERONET_PORT=" | head -n 1 | awk -F '=' '{print $2}') + fi + if [ ${#ZERONET_PORT_MAIN} -gt 1 ]; then + ZERONET_PORT=$ZERONET_PORT_MAIN + fi + if [ ! $ZERONET_PORT ]; then + echo $'No zeronet port was specified' + exit 67433 + fi $CHROOT_PREFIX apt-get -y install python python-msgpack python-gevent $CHROOT_PREFIX apt-get -y install python-pip bittornado @@ -696,9 +708,9 @@ function mesh_batman_client { if [ ! -f /usr/bin/toxic ]; then $CHROOT_PREFIX sudo apt-get -y install toxic echo "n - /nick $USER - /exit - " | ${rootdir}/usr/bin/toxic -d + /nick $USER + /exit + " | ${rootdir}/usr/bin/toxic -d fi fi