diff --git a/src/freedombone-app-tox b/src/freedombone-app-tox index 0956c9e3008c8e8c9727bf7bff5d4407ef005e99..b9eded18f3654223335bc1ef62661ef9bef6ce31 100755 --- a/src/freedombone-app-tox +++ b/src/freedombone-app-tox @@ -314,17 +314,7 @@ function install_tox_client { return fi - ${PROJECT_NAME}-mesh-install -f tox_client - if [ ! "$?" = "0" ]; then - echo $'Could not install Tox client' - exit 67248 - fi - - # initial setup of username - #su -c "echo 'n - #/nick $MY_USERNAME - #/exit - #' | $TOXIC_FILE -d" - $MY_USERNAME + mesh_tox_client echo 'install_tox_client' >> $COMPLETION_FILE } @@ -471,6 +461,11 @@ EOF } function mesh_tox_avahi { + mesh_tox_avahi_prefix='' + if [ $rootdir ]; then + mesh_tox_avahi_prefix="chroot \"$rootdir\"" + fi + if [ ! -d $rootdir/etc/avahi ]; then echo $'tox_avahi: avahi is not installed' exit 87359 @@ -491,7 +486,7 @@ function mesh_tox_avahi { exit 768352 fi - chroot "$rootdir" /bin/bash -x <<EOF + $mesh_tox_avahi_prefix /bin/bash -x <<EOF cd ${INSTALL_DIR}/toxid make make install @@ -508,6 +503,11 @@ EOF } function mesh_tox_client { + mesh_tox_client_prefix='' + if [ $rootdir ]; then + mesh_tox_client_prefix="chroot \"$rootdir\"" + fi + TOXIC_FILE=$(cat /usr/share/${PROJECT_NAME}/apps/${PROJECT_NAME}-app-tox | grep "TOXIC_FILE=" | head -n 1 | awk -F '=' '{print $2}') # obtain commits from the main file @@ -521,8 +521,8 @@ function mesh_tox_client { TOXIC_REPO=$TOXIC_REPO_MAIN fi - chroot "$rootdir" apt-get -y install libncursesw5-dev libconfig-dev libqrencode-dev - chroot "$rootdir" apt-get -y install libcurl4-openssl-dev libvpx-dev libopenal-dev + $mesh_tox_client_prefix apt-get -y install libncursesw5-dev libconfig-dev libqrencode-dev + $mesh_tox_client_prefix apt-get -y install libcurl4-openssl-dev libvpx-dev libopenal-dev TEMP_SCRIPT_NAME=fbtmp728353.sh TEMP_SCRIPT=/tmp/$TEMP_SCRIPT_NAME @@ -543,7 +543,7 @@ function mesh_tox_client { TOXIC_FILE=$(cat /usr/share/${PROJECT_NAME}/apps/${PROJECT_NAME}-app-tox | grep "TOXIC_FILE=" | head -n 1 | awk -F '=' '{print $2}') SECONDS=0 - chroot "$rootdir" /root/$TEMP_SCRIPT_NAME + $mesh_tox_client_prefix /root/$TEMP_SCRIPT_NAME if [ ! "$?" = "0" ]; then duration=$SECONDS echo $"Toxic client compile failed at $(($duration / 60)) minutes and $(($duration % 60)) seconds elapsed."