function to remove blog

This commit is contained in:
Bob Mottram 2016-07-03 20:19:58 +01:00
parent 64a64641d1
commit 84b383b29c
1 changed files with 26 additions and 5 deletions

View File

@ -36,6 +36,27 @@ FULLBLOG_COMMIT='bf5fe9486160be4da86d8987d3e5c977e1dc6d32'
MY_BLOG_TITLE="My Blog"
MY_BLOG_SUBTITLE="Another ${PROJECT_NAME} Blog"
function remove_blog {
if ! grep -Fxq "install_blog" $COMPLETION_FILE; then
return
fi
if [ ! -d /var/www/$FULLBLOG_DOMAIN_NAME ]; then
rm -rf /var/www/$FULLBLOG_DOMAIN_NAME
fi
nginx_dissite $FULLBLOG_DOMAIN_NAME
if [ ! -f /etc/nginx/sites-available/$FULLBLOG_DOMAIN_NAME ]; then
rm -rf /etc/nginx/sites-available/$FULLBLOG_DOMAIN_NAME
fi
if [ $FULLBLOG_CODE ]; then
if [ -f /usr/bin/dynamicdns ]; then
sed -i "/$FULLBLOG_DOMAIN_NAME/d" /usr/bin/dynamicdns
sed -i "/$FULLBLOG_CODE/d" /usr/bin/dynamicdns
fi
fi
sed -i '/install_blog/d' $COMPLETION_FILE
sed -i '/Blog .*/d' $COMPLETION_FILE
}
function mark_blog_domain {
if [[ $SYSTEM_TYPE == "$VARIANT_CLOUD" || $SYSTEM_TYPE == "$VARIANT_MAILBOX" || $SYSTEM_TYPE == "$VARIANT_CHAT" || $SYSTEM_TYPE == "$VARIANT_SOCIAL" || $SYSTEM_TYPE == "$VARIANT_MEDIA" || $SYSTEM_TYPE == "$VARIANT_DEVELOPER" || $SYSTEM_TYPE == "$VARIANT_MESH" ]]; then
return