Function to remove zeronet

This commit is contained in:
Bob Mottram 2016-07-04 20:09:09 +01:00
parent ce9091d34a
commit 7da0bb1e81
2 changed files with 37 additions and 6 deletions

View File

@ -378,6 +378,15 @@ function install_zeronet_forum {
echo 'install_zeronet_forum' >> $COMPLETION_FILE
}
function remove_zeronet {
if ! grep -Fxq "install_zeronet" $COMPLETION_FILE; then
return
fi
${PROJECT_NAME}-mesh-install -f zeronet --remove yes
sed -i '/install_zeronet/d' $COMPLETION_FILE
sed -i '/ZeroNet /d' $COMPLETION_FILE
}
function install_zeronet {
if [[ $SYSTEM_TYPE != "$VARIANT_MESH" ]]; then
return

View File

@ -668,6 +668,24 @@ function mesh_tox_client_toxic_from_repo {
echo "Toxic Installed."
}
function mesh_zeronet_remove {
systemctl stop zeronet
systemctl disable zeronet
systemctl stop tracker
systemctl disable tracker
$CHROOT_PREFIX apt-get -y remove --purge bittornado
if [ -f $rootdir/etc/systemd/system/zeronet.service ]; then
rm $rootdir/etc/systemd/system/zeronet.service
fi
if [ -f $rootdir/etc/systemd/system/tracker.service ]; then
rm $rootdir/etc/systemd/system/tracker.service
fi
if [ -d $rootdir$MESH_INSTALL_DIR/zeronet ]; then
rm -rf $rootdir$MESH_INSTALL_DIR/zeronet
fi
userdel -r zeronet
}
function mesh_zeronet {
# obtain commits from the main file
if [ -f /usr/local/bin/${PROJECT_NAME} ]; then
@ -1122,7 +1140,11 @@ if [[ $FN == 'tox_client' ]]; then
fi
fi
if [[ $FN == 'zeronet' ]]; then
if [[ $REMOVE != 'yes' ]]; then
mesh_zeronet
else
mesh_zeronet_remove
fi
fi
if [[ $FN == 'qtox' ]]; then
mesh_tox_client_qtox