fix color issues with uninstaller

This commit is contained in:
ducoterra
2018-09-22 15:56:03 -04:00
parent 18067d03e8
commit 7eb5e57047
3 changed files with 60 additions and 18 deletions

View File

@@ -1,19 +1,61 @@
# Django Setup for CentOS 7
# Django Installer for CentOS 7
## Quick Install
```bash
vim vars
$ git clone https://gitlab.ducoterra.net/server/django_installer.git
$ cd django_installer
$ vim vars
```
```bash
# django project settings
export user="centos" <-- change to your user
export projectname="mysite"
export hostname="centos.duco.net" <-- change to your hostname
export letsencrypt=False
# django project settings
export user="centos" <---- set to your user (can use nginx)
export projectname="mysite" <---- set to your project name
# TODO:
# change hostname to an array:
# (hostname1.net hostname2.net hostname2.net)
export hostname="centos.duco.net" <---- set to your hostname (ip or domain)
export letsencrypt=False <---- not working yet
```
```bash
sudo ./install.sh
$ sudo ./install.sh
Installing dependencies
Installing gcc
Installing wget
Installing nginx
Installing libsqlite3x-devel.x86_64
Installing postgresql-server
Installing postgresql-devel
Installing postgresql-contrib
Installing bzip2-devel
Installing zlib-devel
Installing libffi-devel
Installing openssl-devel
Installing policycoreutils-python.x86_64
Installing Python
Configure
Make
Make altinstall
Upgrading pip
Installing virtualenv
Starting Django project
Creating venv
Installing django
Installing gunicorn
Installing psycopg2-binary
Starting django project
Collecting static
Making migrations
Migrating
Setting up gunicorn
Starting gunicorn
Enabling gunicorn at startup
Configuring Nginx
Starting nginx
Enabling nginx
Done!
$
```
Done!

View File

@@ -4,7 +4,7 @@ source ./vars
# remove nginx conf
tput setaf 2
echo "Uninstalling nginx"
tput setaf 0
tput setaf 9
systemctl stop nginx 1> /dev/null 2> /dev/null
systemctl disable nginx 1> /dev/null 2> /dev/null
rm -f /etc/nginx/conf.d/$projectname.conf
@@ -12,7 +12,7 @@ rm -f /etc/nginx/conf.d/$projectname.conf
# remove gunicorn
tput setaf 2
echo "Uninstalling gunicorn"
tput setaf 0
tput setaf 9
systemctl disable gunicorn 1> /dev/null 2> /dev/null
systemctl stop gunicorn 1> /dev/null 2> /dev/null
rm -f /etc/systemd/system/gunicorn.service
@@ -20,19 +20,19 @@ rm -f /etc/systemd/system/gunicorn.service
# remove project
tput setaf 2
echo "Removing Django project"
tput setaf 0
tput setaf 9
rm -rf /home/$user/$projectname
# remove python
tput setaf 2
echo "Uninstalling python"
tput setaf 0
tput setaf 9
rm -rf $pyinstalldir
# remove yum dependencies
tput setaf 2
echo "Uninstalling dependencies"
tput setaf 0
tput setaf 9
packages=(gcc wget nginx libsqlite3x-devel.x86_64 postgresql-server postgresql-devel postgresql-contrib bzip2-devel zlib-devel libffi-devel openssl-devel policycoreutils-python.x86_64)
for package in ${packages[@]};
do