More removal functions for zeronet

This commit is contained in:
Bob Mottram 2016-07-04 20:45:49 +01:00
parent 66e2e4d73a
commit e93015723b
1 changed files with 53 additions and 9 deletions

View File

@ -45,6 +45,59 @@ ZERONET_DEFAULT_MAIL_TAGLINE="Mail for the Mesh"
ZERONET_ID_REPO="https://github.com/HelloZeroNet/ZeroID"
ZERONET_ID_COMMIT='ccf14fdc96fa9cdb2ddd8a7ab283a8e17a4f234b'
function remove_zeronet_blog {
if ! grep -Fxq "install_zeronet_blog" $COMPLETION_FILE; then
return
fi
if [ -d $MESH_INSTALL_DIR/zeronet/ZeroBlog ]; then
rm -rf $MESH_INSTALL_DIR/zeronet/ZeroBlog
fi
sed -i '/install_zeronet_blog/d' $COMPLETION_FILE
sed -i '/ZeroNet Blog/d' $COMPLETION_FILE
}
function remove_zeronet_mail {
if ! grep -Fxq "install_zeronet_mail" $COMPLETION_FILE; then
return
fi
if [ -d $MESH_INSTALL_DIR/zeronet/ZeroMail ]; then
rm -rf $MESH_INSTALL_DIR/zeronet/ZeroMail
fi
sed -i '/install_zeronet_mail/d' $COMPLETION_FILE
sed -i '/ZeroNet Mail/d' $COMPLETION_FILE
}
function remove_zeronet_forum {
if ! grep -Fxq "install_zeronet_forum" $COMPLETION_FILE; then
return
fi
if [ -d $MESH_INSTALL_DIR/zeronet/ZeroTalk ]; then
rm -rf $MESH_INSTALL_DIR/zeronet/ZeroTalk
fi
sed -i '/install_zeronet_forum/d' $COMPLETION_FILE
sed -i '/ZeroNet Forum/d' $COMPLETION_FILE
}
function remove_zeronet {
remove_zeronet_blog
remove_zeronet_mail
remove_zeronet_forum
if ! grep -Fxq "install_zeronet" $COMPLETION_FILE; then
return
fi
iptables -D INPUT -i $WIFI_INTERFACE -p udp --dport $ZERONET_PORT -j ACCEPT
iptables -D INPUT -i $WIFI_INTERFACE -p tcp --dport $ZERONET_PORT -j ACCEPT
iptables -D INPUT -i $WIFI_INTERFACE -p udp --dport $TRACKER_PORT -j ACCEPT
iptables -D INPUT -i $WIFI_INTERFACE -p tcp --dport $TRACKER_PORT -j ACCEPT
iptables -D INPUT -i $WIFI_INTERFACE -p udp --dport 1900 -j ACCEPT
function_check save_firewall_settings
save_firewall_settings
${PROJECT_NAME}-mesh-install -f zeronet --remove yes
sed -i '/install_zeronet/d' $COMPLETION_FILE
sed -i '/ZeroNet /d' $COMPLETION_FILE
sed -i '/configure_firewall_for_zeronet/d' $COMPLETION_FILE
}
function configure_firewall_for_zeronet {
if grep -Fxq "configure_firewall_for_zeronet" $COMPLETION_FILE; then
return
@ -378,15 +431,6 @@ 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