Skip to content
Snippets Groups Projects
Commit 3f7be9c1 authored by Bob Mottram's avatar Bob Mottram
Browse files

Function to remove tox

parent 137821b9
No related branches found
No related tags found
No related merge requests found
......@@ -62,6 +62,40 @@ function remove_tox_node {
exit 763836
fi
sed -i '/install_tox_node/d' $COMPLETION_FILE
sed -i '/configure_firewall_for_tox/d' $COMPLETION_FILE
}
function remove_tox_avahi {
if ! grep -Fxq "tox_avahi" $COMPLETION_FILE; then
return
fi
cd $INSTALL_DIR/toxid
make uninstall
rm -rf $INSTALL_DIR/toxid
sed -i '/toxavahi/d' /etc/crontab
systemctl restart cron
sed -i '/tox_avahi/d' $COMPLETION_FILE
}
function remove_tox_client {
if ! grep -Fxq "install_tox_client" $COMPLETION_FILE; then
return
fi
${PROJECT_NAME}-mesh-install -f tox_client --remove yes
if [ ! "$?" = "0" ]; then
echo $'Could not remove Tox client'
exit 737253
fi
sed -i '/install_tox_client/d' $COMPLETION_FILE
sed -i '/Tox /d' $COMPLETION_FILE
sed -i '/Toxic /d' $COMPLETION_FILE
}
function remove_tox {
remove_tox_client
remove_tox_avahi
remove_tox_node
}
function configure_firewall_for_tox {
......
......@@ -589,6 +589,15 @@ function mesh_tox_node {
$CHROOT_PREFIX systemctl enable tox-bootstrapd.service
}
function mesh_tox_client_remove {
if [ ! -d $INSTALL_DIR/toxic ]; then
return
fi
cd $INSTALL_DIR/toxic
make uninstall
rm -rf $INSTALL_DIR/toxic
}
function mesh_tox_client {
if [ -f /usr/local/bin/${PROJECT_NAME} ]; then
TOXIC_FILE=$(cat /usr/local/bin/${PROJECT_NAME}-app-tox | grep "TOXIC_FILE=" | head -n 1 | awk -F '=' '{print $2}')
......@@ -1106,7 +1115,11 @@ if [[ $FN == 'tox_node' ]]; then
fi
fi
if [[ $FN == 'tox_client' ]]; then
mesh_tox_client
if [[ $REMOVE != 'yes' ]]; then
mesh_tox_client
else
mesh_tox_client_remove
fi
fi
if [[ $FN == 'zeronet' ]]; then
mesh_zeronet
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment