From 37ec4cebf8916bf1bf044ac5e76e4f9ffceed228 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Tue, 12 Apr 2016 14:47:55 +0100 Subject: [PATCH] Check that tox client gets installed --- src/freedombone-mesh-install | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/freedombone-mesh-install b/src/freedombone-mesh-install index 67a04517..ab15ae13 100755 --- a/src/freedombone-mesh-install +++ b/src/freedombone-mesh-install @@ -568,7 +568,7 @@ function mesh_tox_client { else TOXIC_COMMIT_MAIN=$(cat /usr/bin/freedombone | grep "TOXIC_COMMIT=" | head -n 1 | awk -F "'" '{print $2}') fi - if [ ${#TOX_COMMIT_MAIN} -gt 10 ]; then + if [ ${#TOXIC_COMMIT_MAIN} -gt 10 ]; then TOXIC_COMMIT=$TOXIC_COMMIT_MAIN fi @@ -578,13 +578,19 @@ function mesh_tox_client { $CHROOT_PREFIX git_clone $TOXIC_REPO $INSTALL_DIR/toxic $CHROOT_PREFIX cd $INSTALL_DIR/toxic $CHROOT_PREFIX git checkout $TOXIC_COMMIT -b $TOXIC_COMMIT - echo "Toxic commit:$TOXIC_COMMIT" >> $rootdir$COMPLETION_FILE - + if ! grep -q "Toxic commit" $rootdir$COMPLETION_FILE; then + echo "Toxic commit:$TOXIC_COMMIT" >> $rootdir$COMPLETION_FILE + fi + $CHROOT_PREFIX make if [ ! -f $INSTALL_DIR/toxic/build/toxic ]; then exit 74872 fi $CHROOT_PREFIX make install + if [ ! -f /usr/local/bin/toxic ]; then + echo $'Tox client was not installed' + exit 63278 + fi } function mesh_zeronet { @@ -708,9 +714,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