Compile toxid on mesh nodes

This commit is contained in:
Bob Mottram 2016-05-29 14:12:57 +01:00
parent 7bd33c9a44
commit 68b0ae84a8
2 changed files with 57 additions and 13 deletions

View File

@ -596,19 +596,6 @@ function mesh_tox_node {
exit 76325
fi
if [ -f /usr/local/bin/${PROJECT_NAME} ]; then
TOXID_REPO_MAIN=$(cat /usr/local/bin/${PROJECT_NAME} | grep "TOXID_REPO=" | head -n 1 | awk -F '"' '{print $2}')
else
TOXID_REPO_MAIN=$(cat /usr/bin/${PROJECT_NAME} | grep "TOXID_REPO=" | head -n 1 | awk -F '"' '{print $2}')
fi
if [ ${#TOXID_REPO_MAIN} -gt 5 ]; then
TOXID_REPO=$TOXID_REPO_MAIN
fi
if [ ! $TOXID_REPO ]; then
echo $'No ToxID repo was specified'
exit 78252
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}')
else
@ -658,6 +645,33 @@ function mesh_tox_node {
fi
}
function mesh_tox_avahi {
if [ ! -d $rootdir/etc/avahi ]; then
echo $'tox_avahi: avahi is not installed'
exit 87359
fi
if [ -f /usr/local/bin/${PROJECT_NAME} ]; then
TOXID_REPO_MAIN=$(cat /usr/local/bin/${PROJECT_NAME} | grep "TOXID_REPO=" | head -n 1 | awk -F '"' '{print $2}')
else
TOXID_REPO_MAIN=$(cat /usr/bin/${PROJECT_NAME} | grep "TOXID_REPO=" | head -n 1 | awk -F '"' '{print $2}')
fi
if [ ${#TOXID_REPO_MAIN} -gt 5 ]; then
TOXID_REPO=$TOXID_REPO_MAIN
fi
if [ ! $TOXID_REPO ]; then
echo $'No ToxID repo was specified'
exit 78252
fi
# install a command to obtain the Tox ID
chroot "$rootdir" $INSTALL_DIR
chroot "$rootdir" git clone $TOXID_REPO $INSTALL_DIR/toxid
if [ ! -d $rootdir$INSTALL_DIR/toxid ]; then
exit 63921
fi
}
function mesh_tox_client {
if [ -f /usr/local/bin/${PROJECT_NAME} ]; then
TOXIC_FILE=$(cat /usr/local/bin/${PROJECT_NAME} | grep "TOXIC_FILE=" | head -n 1 | awk -F '=' '{print $2}')
@ -822,6 +836,7 @@ initialise_mesh() {
mesh_avahi
mesh_batman
mesh_tox_node
mesh_tox_avahi
mesh_tox_client
mesh_zeronet

View File

@ -386,6 +386,34 @@ function compile_toxcore {
echo $'toxcore compile completed' >> $INSTALL_LOG
}
function compile_toxid {
if [ ! -d $INSTALL_DIR/toxid ]; then
echo $'toxid repo not found' >> $INSTALL_LOG
exit 52682
fi
cd $INSTALL_DIR/toxid
if [ -f $INSTALL_DIR/make_toxid.txt ]; then
rm $INSTALL_DIR/make_toxid.txt
fi
make > $INSTALL_DIR/make_toxid.txt
if [ ! "$?" = "0" ]; then
echo $'Failed to compile toxid' >> $INSTALL_LOG
echo $"See $INSTALL_DIR/make_toxid.txt" >> $INSTALL_LOG
exit 58432
fi
rm $INSTALL_DIR/make_toxid.txt
make install
toxavahi
# publish regularly
if ! grep -q "toxavahi" /etc/crontab; then
echo "* * * * * root toxavahi > /dev/null" >> /etc/crontab
fi
systemctl restart avahi-daemon
}
function compile_tox_client {
echo $'Compiling tox client' >> $INSTALL_LOG
@ -479,6 +507,7 @@ if [ -f /root/.initial_mesh_setup ]; then
configure_zeronet_mail
configure_zeronet_forum
compile_toxcore
compile_toxid
compile_tox_client
configure_toxcore
configure_zeronet