add uninstaller
This commit is contained in:
@@ -296,4 +296,4 @@ if [ ! $user = "nginx" ] ; then
|
||||
sed -i "s/user nginx/user $user nginx/" /etc/nginx/nginx.conf
|
||||
fi
|
||||
```
|
||||
Which inserts the specified user (if not nginx) into nginx.conf.
|
||||
Which inserts the specified user (if not nginx) into nginx.conf. The script finishes by enabling gunicorn and nginx at startup.
|
||||
26
uninstall.sh
26
uninstall.sh
@@ -0,0 +1,26 @@
|
||||
# remove nginx conf
|
||||
systemctl disable nginx
|
||||
rm -f /etc/nginx/conf.d/$projectname.conf
|
||||
|
||||
# remove gunicorn
|
||||
systemctl disable gunicorn
|
||||
systemctl stop gunicorn
|
||||
rm -f /etc/systemd/system/gunicorn.service
|
||||
|
||||
# remove project
|
||||
rm -rf /home/$user/$projectname
|
||||
|
||||
# remove python
|
||||
rm -rf $pyinstalldir
|
||||
|
||||
# remove yum dependencies
|
||||
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
|
||||
echo -e "\tInstalling $package"
|
||||
yum -y erase $package 1>> $yumlogloc 2>> $yumlogloc 3>> $yumlogloc
|
||||
if [ $? -ne 0 ] ; then
|
||||
echo -e "yum failed to remove $package. $yumlogmsg"
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
Reference in New Issue
Block a user