fix adduser command

This commit is contained in:
ducoterra
2018-09-16 22:58:55 -04:00
parent 6860fde53c
commit e695c08569
2 changed files with 11 additions and 5 deletions

View File

@@ -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

View File

@@ -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