diff --git a/src/freedombone-app-gnusocial b/src/freedombone-app-gnusocial index 85c2299e..d93fecb9 100755 --- a/src/freedombone-app-gnusocial +++ b/src/freedombone-app-gnusocial @@ -47,6 +47,23 @@ SHARINGS_COMMIT='d5c6c7f855d9afff9086c09ea706f38c859bc0d4' SHARINGS_THEME_REPO="http://git.lasindias.club/manuel/SharingsTheme" SHARINGS_THEME_COMMIT='7106c7ef03' +function remove_gnu_social { + if ! grep -Fxq "install_gnu_social" $COMPLETION_FILE; then + return + fi + nginx_dissite $MICROBLOG_DOMAIN_NAME + if [ -d /var/www/$MICROBLOG_DOMAIN_NAME ]; then + rm -rf /var/www/$MICROBLOG_DOMAIN_NAME + fi + if [ -f /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME ]; then + rm /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME + fi + function_check drop_database + drop_database gnusocial + sed -i '/install_gnu_social/d' $COMPLETION_FILE + sed -i '/GNU Social /d' $COMPLETION_FILE +} + function install_gnu_social { if [[ $SYSTEM_TYPE == "$VARIANT_CLOUD" || $SYSTEM_TYPE == "$VARIANT_MAILBOX" || $SYSTEM_TYPE == "$VARIANT_CHAT" || $SYSTEM_TYPE == "$VARIANT_WRITER" || $SYSTEM_TYPE == "$VARIANT_MEDIA" || $SYSTEM_TYPE == "$VARIANT_DEVELOPER" || $SYSTEM_TYPE == "$VARIANT_MESH" ]]; then return diff --git a/src/freedombone-utils-database b/src/freedombone-utils-database index 429c558d..7f0b12c0 100755 --- a/src/freedombone-utils-database +++ b/src/freedombone-utils-database @@ -322,4 +322,9 @@ function run_query { mysql -u root --password="$MARIADB_PASSWORD" -e "$database_query" $database_name } +function drop_database { + database_name=$1 + mysqladmin -uroot -p"$MARIADB_PASSWORD" -f drop $database_name +} + # NOTE: deliberately there is no "exit 0"