fix adduser command
This commit is contained in:
@@ -129,11 +129,7 @@ tput setaf 2
|
|||||||
echo -e "Starting Django project"
|
echo -e "Starting Django project"
|
||||||
tput setaf 0
|
tput setaf 0
|
||||||
|
|
||||||
# check user and create dirs
|
adduser $user > /dev/null
|
||||||
id -u $user > /dev/null
|
|
||||||
if [ $? = 0 ]; then
|
|
||||||
adduser $user
|
|
||||||
fi
|
|
||||||
if [ ! -d "/home/$user" ] ; then
|
if [ ! -d "/home/$user" ] ; then
|
||||||
mkdir /home/$user
|
mkdir /home/$user
|
||||||
chown -R $user:$user /home/$user
|
chown -R $user:$user /home/$user
|
||||||
|
|||||||
10
uninstall.sh
10
uninstall.sh
@@ -1,25 +1,35 @@
|
|||||||
# remove nginx conf
|
# remove nginx conf
|
||||||
|
tput setaf 2
|
||||||
echo "Uninstalling nginx"
|
echo "Uninstalling nginx"
|
||||||
|
tput setaf 0
|
||||||
systemctl stop nginx > /dev/null
|
systemctl stop nginx > /dev/null
|
||||||
systemctl disable nginx > /dev/null
|
systemctl disable nginx > /dev/null
|
||||||
rm -f /etc/nginx/conf.d/$projectname.conf
|
rm -f /etc/nginx/conf.d/$projectname.conf
|
||||||
|
|
||||||
# remove gunicorn
|
# remove gunicorn
|
||||||
|
tput setaf 2
|
||||||
echo "Uninstalling gunicorn"
|
echo "Uninstalling gunicorn"
|
||||||
|
tput setaf 0
|
||||||
systemctl disable gunicorn > /dev/null
|
systemctl disable gunicorn > /dev/null
|
||||||
systemctl stop gunicorn > /dev/null
|
systemctl stop gunicorn > /dev/null
|
||||||
rm -f /etc/systemd/system/gunicorn.service
|
rm -f /etc/systemd/system/gunicorn.service
|
||||||
|
|
||||||
# remove project
|
# remove project
|
||||||
|
tput setaf 2
|
||||||
echo "Removing Django project"
|
echo "Removing Django project"
|
||||||
|
tput setaf 0
|
||||||
rm -rf /home/$user/$projectname
|
rm -rf /home/$user/$projectname
|
||||||
|
|
||||||
# remove python
|
# remove python
|
||||||
|
tput setaf 2
|
||||||
echo "Uninstalling python"
|
echo "Uninstalling python"
|
||||||
|
tput setaf 0
|
||||||
rm -rf $pyinstalldir
|
rm -rf $pyinstalldir
|
||||||
|
|
||||||
# remove yum dependencies
|
# remove yum dependencies
|
||||||
|
tput setaf 2
|
||||||
echo "Uninstalling dependencies"
|
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)
|
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[@]};
|
for package in ${packages[@]};
|
||||||
do
|
do
|
||||||
|
|||||||
Reference in New Issue
Block a user