Selaa lähdekoodia

function to remove gnu social

Bob Mottram 8 vuotta sitten
vanhempi
commit
4d2c1836ac
2 muutettua tiedostoa jossa 22 lisäystä ja 0 poistoa
  1. 17
    0
      src/freedombone-app-gnusocial
  2. 5
    0
      src/freedombone-utils-database

+ 17
- 0
src/freedombone-app-gnusocial Näytä tiedosto

@@ -47,6 +47,23 @@ SHARINGS_COMMIT='d5c6c7f855d9afff9086c09ea706f38c859bc0d4'
47 47
 SHARINGS_THEME_REPO="http://git.lasindias.club/manuel/SharingsTheme"
48 48
 SHARINGS_THEME_COMMIT='7106c7ef03'
49 49
 
50
+function remove_gnu_social {
51
+	if ! grep -Fxq "install_gnu_social" $COMPLETION_FILE; then
52
+		return
53
+	fi
54
+	nginx_dissite $MICROBLOG_DOMAIN_NAME
55
+	if [ -d /var/www/$MICROBLOG_DOMAIN_NAME ]; then
56
+		rm -rf /var/www/$MICROBLOG_DOMAIN_NAME
57
+	fi
58
+	if [ -f /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME ]; then
59
+		rm /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
60
+	fi
61
+	function_check drop_database
62
+	drop_database gnusocial
63
+	sed -i '/install_gnu_social/d' $COMPLETION_FILE
64
+	sed -i '/GNU Social /d' $COMPLETION_FILE
65
+}
66
+
50 67
 function install_gnu_social {
51 68
 	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
52 69
 		return

+ 5
- 0
src/freedombone-utils-database Näytä tiedosto

@@ -322,4 +322,9 @@ function run_query {
322 322
 	mysql -u root --password="$MARIADB_PASSWORD" -e "$database_query" $database_name
323 323
 }
324 324
 
325
+function drop_database {
326
+	database_name=$1
327
+	mysqladmin -uroot -p"$MARIADB_PASSWORD" -f drop $database_name
328
+}
329
+
325 330
 # NOTE: deliberately there is no "exit 0"