fix uninstall message

This commit is contained in:
ducoterra
2018-09-16 22:54:46 -04:00
parent 7e0f9f7d3c
commit 6860fde53c

19
uninstall.sh Normal file → Executable file
View File

@@ -1,26 +1,31 @@
# remove nginx conf
systemctl disable nginx
echo "Uninstalling nginx"
systemctl stop nginx > /dev/null
systemctl disable nginx > /dev/null
rm -f /etc/nginx/conf.d/$projectname.conf
# remove gunicorn
systemctl disable gunicorn
systemctl stop gunicorn
echo "Uninstalling gunicorn"
systemctl disable gunicorn > /dev/null
systemctl stop gunicorn > /dev/null
rm -f /etc/systemd/system/gunicorn.service
# remove project
echo "Removing Django project"
rm -rf /home/$user/$projectname
# remove python
echo "Uninstalling python"
rm -rf $pyinstalldir
# remove yum dependencies
echo "Uninstalling 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
echo -e "\tRemoving $package"
yum -y erase $package 1>> /dev/null 2>> /dev/null 3>> /dev/null
if [ $? -ne 0 ] ; then
echo -e "yum failed to remove $package. $yumlogmsg"
exit 1
echo -e "\tyum failed to remove $package."
fi
done