From e695c08569f9d96a5fc45e662676cd98a7b2e4e1 Mon Sep 17 00:00:00 2001 From: ducoterra Date: Sun, 16 Sep 2018 22:58:55 -0400 Subject: [PATCH] fix adduser command --- install.sh | 6 +----- uninstall.sh | 10 ++++++++++ 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/install.sh b/install.sh index 7ec6f5f..95ba838 100755 --- a/install.sh +++ b/install.sh @@ -129,11 +129,7 @@ tput setaf 2 echo -e "Starting Django project" tput setaf 0 -# check user and create dirs -id -u $user > /dev/null -if [ $? = 0 ]; then - adduser $user -fi +adduser $user > /dev/null if [ ! -d "/home/$user" ] ; then mkdir /home/$user chown -R $user:$user /home/$user diff --git a/uninstall.sh b/uninstall.sh index eb57182..6fa51d9 100755 --- a/uninstall.sh +++ b/uninstall.sh @@ -1,25 +1,35 @@ # remove nginx conf +tput setaf 2 echo "Uninstalling nginx" +tput setaf 0 systemctl stop nginx > /dev/null systemctl disable nginx > /dev/null rm -f /etc/nginx/conf.d/$projectname.conf # remove gunicorn +tput setaf 2 echo "Uninstalling gunicorn" +tput setaf 0 systemctl disable gunicorn > /dev/null systemctl stop gunicorn > /dev/null rm -f /etc/systemd/system/gunicorn.service # remove project +tput setaf 2 echo "Removing Django project" +tput setaf 0 rm -rf /home/$user/$projectname # remove python +tput setaf 2 echo "Uninstalling python" +tput setaf 0 rm -rf $pyinstalldir # remove yum dependencies +tput setaf 2 echo "Uninstalling dependencies" +tput setaf 0 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