add uninstaller

This commit is contained in:
ducoterra
2019-04-16 20:45:11 -04:00
parent 6f47be3532
commit 9c42d31518

View File

@@ -8,38 +8,25 @@
source vars source vars
# remove nginx conf # remove nginx conf
tput setaf 2
echo "Disabling nginx" echo "Disabling nginx"
tput setaf 9
systemctl stop nginx 1> /dev/null 2> /dev/null systemctl stop nginx 1> /dev/null 2> /dev/null
systemctl disable nginx 1> /dev/null 2> /dev/null systemctl disable nginx 1> /dev/null 2> /dev/null
rm -f /etc/nginx/conf.d/$projectname.conf
# remove gunicorn
tput setaf 2
echo "Uninstalling gunicorn"
tput setaf 9
systemctl disable gunicorn 1> /dev/null 2> /dev/null
systemctl stop gunicorn 1> /dev/null 2> /dev/null
rm -f /etc/systemd/system/gunicorn.service
# remove project
tput setaf 2
echo "Removing Django project"
tput setaf 9
rm -rf /home/$user/$projectname
# remove python # remove python
tput setaf 2 echo "Uninstalling Python"
echo "Uninstalling python" for dir in $(whereis python3);
tput setaf 9 do rm -r $dir;
rm -rf $pyinstalldir done;
# remove sqlite
echo "Uninstalling Sqlite3"
for dir in $(whereis sqlite3);
do rm -r $dir;
done;
# remove yum dependencies # remove yum dependencies
tput setaf 2
echo "Uninstalling dependencies" echo "Uninstalling dependencies"
tput setaf 9
packages=(gcc wget nginx ufw make sqlite3 bzip2 openssl libffi-dev libssl-dev libsqlite3-dev zlib1g-dev libbz2-dev)
for package in ${packages[@]}; for package in ${packages[@]};
do do
echo -e "\tRemoving $package" echo -e "\tRemoving $package"