summaryrefslogtreecommitdiff
path: root/install/uninstall.sh
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@proxience.com>2015-04-18 17:25:40 +0200
committerÉtienne Loks <etienne.loks@proxience.com>2015-04-18 17:28:31 +0200
commita82c8859bd4ceda956dd58e97a3c0e4fc4179229 (patch)
treed1bf16bb9ad133354a23301738993f765653f83f /install/uninstall.sh
parente3a061f50b538e88884a0e89b99d40f6a0e193c3 (diff)
downloadIshtar-a82c8859bd4ceda956dd58e97a3c0e4fc4179229.tar.bz2
Ishtar-a82c8859bd4ceda956dd58e97a3c0e4fc4179229.zip
Update installation script
Conflicts: install/install.sh
Diffstat (limited to 'install/uninstall.sh')
-rwxr-xr-xinstall/uninstall.sh36
1 files changed, 36 insertions, 0 deletions
diff --git a/install/uninstall.sh b/install/uninstall.sh
new file mode 100755
index 000000000..71a5dae17
--- /dev/null
+++ b/install/uninstall.sh
@@ -0,0 +1,36 @@
+#!/bin/bash
+
+# only lower alpha-numeric char and '_' and must start with a letter
+[ $APP_NAME ] || ( echo 'APP_NAME empty. Default to: "default".' ; );
+APP_NAME=${APP_NAME-default}
+# don't forget the trailing slash
+INSTALL_PREFIX=/srv/
+
+read -r -p "Are you sure to delete "$APP_NAME" app? [y/N] " response
+response=${response,,} # tolower
+if [[ $response =~ ^(yes|y)$ ]]
+then
+ echo '* deleting '$APP_NAME;
+else
+ echo "canceled";
+ exit;
+fi
+
+# default for debian
+UWSGI_AVAILABLE_PATH='/etc/uwsgi/apps-available/'
+UWSGI_ENABLE_PATH='/etc/uwsgi/apps-enabled/'
+NGINX_AVAILABLE_PATH='/etc/nginx/sites-available/'
+NGINX_ENABLE_PATH='/etc/nginx/sites-enabled/'
+
+DB_NAME='ishtar'$APP_NAME
+INSTALL_PATH=$INSTALL_PREFIX$DB_NAME
+
+rm -f $UWSGI_AVAILABLE_PATH$APP_NAME'.ini'
+rm -f $UWSGI_ENABLE_PATH$APP_NAME'.ini'
+rm -f $NGINX_AVAILABLE_PATH$APP_NAME'.conf'
+rm -f $NGINX_ENABLE_PATH$APP_NAME'.conf'
+
+rm -rf $INSTALL_PATH
+
+echo "All file cleaned."
+echo "You can delete database '"$DB_NAME"' to fully clean your installation."