Add uninstall scripts

This commit is contained in:
Disassembler 2018-10-27 15:33:22 +02:00
parent 38524e70af
commit 6fb1e12ca6
Signed by: Disassembler
GPG Key ID: 524BD33A0EE29499
25 changed files with 283 additions and 0 deletions

6
activemq/uninstall.sh Executable file
View File

@ -0,0 +1,6 @@
#!/bin/sh
set -e
# Remove service
rm /etc/init.d/activemq
rc-update -u

6
ckan-datapusher/uninstall.sh Executable file
View File

@ -0,0 +1,6 @@
#!/bin/sh
set -e
# Remove service
rm /etc/init.d/ckan-datapusher
rc-update -u

25
ckan/uninstall.sh Executable file
View File

@ -0,0 +1,25 @@
#!/bin/sh
set -e
# Remove cronjob
rm /etc/periodic/hourly/ckan
# Remove service
rc-update del ckan || true
rm /etc/init.d/ckan
rc-update -u
# Drop database and user
[ ! -e /run/openrc/started/postgres ] && service postgres start && STOP_POSTGRES=1
echo 'DROP DATABASE ckan; DROP ROLE ckan;' | lxc-attach -u 5432 -g 5432 postgres -- psql
[ ! -z ${STOP_POSTGRES} ] && service postgres stop
# Remove redis data
[ ! -e /run/openrc/started/redis ] && service redis start && STOP_REDIS=1
lxc-attach redis -- redis-cli -n 0 flushdb
[ ! -z ${STOP_REDIS} ] && service redis stop
# Remove solr core
[ -e /run/openrc/started/solr ] && service solr stop && START_SOLR=1
rm -rf /srv/solr/data/ckan
[ ! -z ${START_SOLR} ] && service solr start

12
crisiscleanup/uninstall.sh Executable file
View File

@ -0,0 +1,12 @@
#!/bin/sh
set -e
# Remove service
rc-update del crisiscleanup || true
rm /etc/init.d/crisiscleanup
rc-update -u
# Drop database and user
[ ! -e /run/openrc/started/postgres ] && service postgres start && STOP_POSTGRES=1
echo 'DROP DATABASE crisiscleanup; DROP ROLE crisiscleanup;' | lxc-attach -u 5432 -g 5432 postgres -- psql
[ ! -z ${STOP_POSTGRES} ] && service postgres stop

12
cts/uninstall.sh Executable file
View File

@ -0,0 +1,12 @@
#!/bin/sh
set -e
# Remove service
rc-update del cts || true
rm /etc/init.d/cts
rc-update -u
# Drop database and user
[ ! -e /run/openrc/started/postgres ] && service postgres start && STOP_POSTGRES=1
echo 'DROP DATABASE cts; DROP ROLE cts;' | lxc-attach -u 5432 -g 5432 postgres -- psql
[ ! -z ${STOP_POSTGRES} ] && service postgres stop

7
frontlinesms/uninstall.sh Executable file
View File

@ -0,0 +1,7 @@
#!/bin/sh
set -e
# Remove service
rc-update del frontlinesms || true
rm /etc/init.d/frontlinesms
rc-update -u

12
gnuhealth/uninstall.sh Executable file
View File

@ -0,0 +1,12 @@
#!/bin/sh
set -e
# Remove service
rc-update del gnuhealth || true
rm /etc/init.d/gnuhealth
rc-update -u
# Drop database and user
[ ! -e /run/openrc/started/postgres ] && service postgres start && STOP_POSTGRES=1
echo 'DROP DATABASE gnuhealth; DROP DATABASE gnuhealth_demo; DROP ROLE gnuhealth;' | lxc-attach -u 5432 -g 5432 postgres -- psql
[ ! -z ${STOP_POSTGRES} ] && service postgres stop

15
kanboard/uninstall.sh Executable file
View File

@ -0,0 +1,15 @@
#!/bin/sh
set -e
# Remove cronjob
rm /etc/periodic/daily/kanboard
# Remove service
rc-update del kanboard || true
rm /etc/init.d/kanboard
rc-update -u
# Drop database and user
[ ! -e /run/openrc/started/postgres ] && service postgres start && STOP_POSTGRES=1
echo 'DROP DATABASE kanboard; DROP ROLE kanboard;' | lxc-attach -u 5432 -g 5432 postgres -- psql
[ ! -z ${STOP_POSTGRES} ] && service postgres stop

6
mariadb/uninstall.sh Executable file
View File

@ -0,0 +1,6 @@
#!/bin/sh
set -e
# Remove service
rm /etc/init.d/mariadb
rc-update -u

12
mifosx/uninstall.sh Executable file
View File

@ -0,0 +1,12 @@
#!/bin/sh
set -e
# Remove service
rc-update del mifosx || true
rm /etc/init.d/mifosx
rc-update -u
# Drop database and user
[ ! -e /run/openrc/started/mariadb ] && service mariadb start && STOP_MARIADB=1
echo 'DROP DATABASE mifosplatform-tenants; DROP DATABASE mifostenant-default; DROP USER mifosx;' | lxc-attach mariadb -- mysql
[ ! -z ${STOP_MARIADB} ] && service mariadb stop

14
motech/uninstall.sh Executable file
View File

@ -0,0 +1,14 @@
#!/bin/sh
set -e
# Remove service
rc-update del motech || true
rm /etc/init.d/motech
rc-update -u
# Drop database and user
[ ! -e /run/openrc/started/postgres ] && service postgres start && STOP_POSTGRES=1
echo 'DROP DATABASE motech; DROP DATABASE motechdata; DROP DATABASE motechquartz; DROP DATABASE motechschema; DROP ROLE motech;' | lxc-attach -u 5432 -g 5432 postgres -- psql
[ ! -z ${STOP_POSTGRES} ] && service postgres stop
# TODO: Clear ActiveMQ config

12
opendatakit-build/uninstall.sh Executable file
View File

@ -0,0 +1,12 @@
#!/bin/sh
set -e
# Remove service
rc-update del opendatakit-build || true
rm /etc/init.d/opendatakit-build
rc-update -u
# Drop database and user
[ ! -e /run/openrc/started/postgres ] && service postgres start && STOP_POSTGRES=1
echo 'DROP DATABASE opendatakit-build; DROP ROLE opendatakit-build;' | lxc-attach -u 5432 -g 5432 postgres -- psql
[ ! -z ${STOP_POSTGRES} ] && service postgres stop

12
opendatakit/uninstall.sh Executable file
View File

@ -0,0 +1,12 @@
#!/bin/sh
set -e
# Remove service
rc-update del opendatakit || true
rm /etc/init.d/opendatakit
rc-update -u
# Drop database and user
[ ! -e /run/openrc/started/postgres ] && service postgres start && STOP_POSTGRES=1
echo 'DROP DATABASE opendatakit; DROP ROLE opendatakit;' | lxc-attach -u 5432 -g 5432 postgres -- psql
[ ! -z ${STOP_POSTGRES} ] && service postgres stop

12
openmapkit/uninstall.sh Executable file
View File

@ -0,0 +1,12 @@
#!/bin/sh
set -e
# Remove service
rc-update del openmapkit || true
rm /etc/init.d/openmapkit
rc-update -u
# Drop database and user
[ ! -e /run/openrc/started/postgres ] && service postgres start && STOP_POSTGRES=1
echo 'DROP DATABASE openmapkit; DROP ROLE openmapkit;' | lxc-attach -u 5432 -g 5432 postgres -- psql
[ ! -z ${STOP_POSTGRES} ] && service postgres stop

18
pandora/uninstall.sh Executable file
View File

@ -0,0 +1,18 @@
#!/bin/sh
set -e
# Remove service
rc-update del pandora || true
rm /etc/init.d/pandora
rc-update -u
# Drop database and user
[ ! -e /run/openrc/started/postgres ] && service postgres start && STOP_POSTGRES=1
echo 'DROP DATABASE pandora; DROP ROLE pandora;' | lxc-attach -u 5432 -g 5432 postgres -- psql
[ ! -z ${STOP_POSTGRES} ] && service postgres stop
# Remove RabbitMQ vhost and user
[ ! -e /run/openrc/started/rabbitmq ] && service rabbitmq start && STOP_RABBITMQ=1
lxc-attach rabbitmq -- rabbitmqctl delete_vhost /pandora
lxc-attach rabbitmq -- rabbitmqctl delete_user pandora
[ ! -z ${STOP_RABBITMQ} ] && service rabbitmq stop

6
postgres/uninstall.sh Executable file
View File

@ -0,0 +1,6 @@
#!/bin/sh
set -e
# Remove service
rm /etc/init.d/postgres
rc-update -u

6
rabbitmq/uninstall.sh Executable file
View File

@ -0,0 +1,6 @@
#!/bin/sh
set -e
# Remove service
rm /etc/init.d/rabbitmq
rc-update -u

6
redis/uninstall.sh Executable file
View File

@ -0,0 +1,6 @@
#!/bin/sh
set -e
# Remove service
rm /etc/init.d/redis
rc-update -u

12
sahana-demo/uninstall.sh Executable file
View File

@ -0,0 +1,12 @@
#!/bin/sh
set -e
# Remove service
rc-update del sahana-demo || true
rm /etc/init.d/sahana-demo
rc-update -u
# Drop database and user
[ ! -e /run/openrc/started/postgres ] && service postgres start && STOP_POSTGRES=1
echo 'DROP DATABASE sahanademo; DROP ROLE sahanademo;' | lxc-attach -u 5432 -g 5432 postgres -- psql
[ ! -z ${STOP_POSTGRES} ] && service postgres stop

12
sahana/uninstall.sh Executable file
View File

@ -0,0 +1,12 @@
#!/bin/sh
set -e
# Remove service
rc-update del sahana || true
rm /etc/init.d/sahana
rc-update -u
# Drop database and user
[ ! -e /run/openrc/started/postgres ] && service postgres start && STOP_POSTGRES=1
echo 'DROP DATABASE sahana; DROP ROLE sahana;' | lxc-attach -u 5432 -g 5432 postgres -- psql
[ ! -z ${STOP_POSTGRES} ] && service postgres stop

12
sambro/uninstall.sh Executable file
View File

@ -0,0 +1,12 @@
#!/bin/sh
set -e
# Remove service
rc-update del sambro || true
rm /etc/init.d/sambro
rc-update -u
# Drop database and user
[ ! -e /run/openrc/started/postgres ] && service postgres start && STOP_POSTGRES=1
echo 'DROP DATABASE sambro; DROP ROLE sambro;' | lxc-attach -u 5432 -g 5432 postgres -- psql
[ ! -z ${STOP_POSTGRES} ] && service postgres stop

15
seeddms/uninstall.sh Executable file
View File

@ -0,0 +1,15 @@
#!/bin/sh
set -e
# Remove cronjob
/etc/periodic/hourly/seeddms
# Remove service
rc-update del seeddms || true
rm /etc/init.d/seeddms
rc-update -u
# Drop database and user
[ ! -e /run/openrc/started/postgres ] && service postgres start && STOP_POSTGRES=1
echo 'DROP DATABASE seeddms; DROP ROLE seeddms;' | lxc-attach -u 5432 -g 5432 postgres -- psql
[ ! -z ${STOP_POSTGRES} ] && service postgres stop

12
sigmah/uninstall.sh Executable file
View File

@ -0,0 +1,12 @@
#!/bin/sh
set -e
# Remove service
rc-update del sigmah || true
rm /etc/init.d/sigmah
rc-update -u
# Drop database and user
[ ! -e /run/openrc/started/postgres ] && service postgres start && STOP_POSTGRES=1
echo 'DROP DATABASE sigmah; DROP ROLE sigmah;' | lxc-attach -u 5432 -g 5432 postgres -- psql
[ ! -z ${STOP_POSTGRES} ] && service postgres stop

6
solr/uninstall.sh Executable file
View File

@ -0,0 +1,6 @@
#!/bin/sh
set -e
# Remove service
rm /etc/init.d/solr
rc-update -u

15
ushahidi/uninstall.sh Executable file
View File

@ -0,0 +1,15 @@
#!/bin/sh
set -e
# Remove cronjob
rm /etc/periodic/15min/ushahidi
# Remove service
rc-update del ushahidi || true
rm /etc/init.d/ushahidi
rc-update -u
# Drop database and user
[ ! -e /run/openrc/started/mariadb ] && service mariadb start && STOP_MARIADB=1
echo 'DROP DATABASE ushahidi; DROP USER ushahidi;' | lxc-attach mariadb -- mysql
[ ! -z ${STOP_MARIADB} ] && service mariadb stop