don't redownload python

This commit is contained in:
ducoterra
2019-04-16 21:21:32 -04:00
parent f0333c9b27
commit e8d23701e0
3 changed files with 40 additions and 35 deletions

View File

@@ -39,19 +39,21 @@ done
################################################################################ ################################################################################
echo -e "Installing Sqlite3" echo -e "Installing Sqlite3"
# fetch Sqlite if [ ! -d sqlite ] ; then
wget -O sqlite.tar.gz $sqlink 1> $pylogloc 2>> $pylogloc 3>> $pylogloc # fetch Sqlite
if [ $? -ne 0 ] ; then wget -O sqlite.tar.gz $sqlink 1> $pylogloc 2>> $pylogloc 3>> $pylogloc
if [ $? -ne 0 ] ; then
echo -e "Failed to fetch sqlite, make sure wget is installed and $pylink is what you're after. $pylogmsg" echo -e "Failed to fetch sqlite, make sure wget is installed and $pylink is what you're after. $pylogmsg"
exit 1 exit 1
fi fi
mkdir sqlite mkdir sqlite
tar xf sqlite.tar.gz -C sqlite --strip-components=1 1>> $pylogloc 2>> $pylogloc 3>> $pylogloc tar xf sqlite.tar.gz -C sqlite --strip-components=1 1>> $pylogloc 2>> $pylogloc 3>> $pylogloc
if [ $? -ne 0 ] ; then if [ $? -ne 0 ] ; then
echo -e "Failed to unzip sqlite. $pylogmsg" echo -e "Failed to unzip sqlite. $pylogmsg"
exit 1 exit 1
fi fi
fi;
cd sqlite cd sqlite
if [ $? -ne 0 ] ; then if [ $? -ne 0 ] ; then
@@ -83,7 +85,6 @@ fi
cd .. cd ..
rm sqlite.tar.gz 1>> $pylogloc 2>> $pylogloc rm sqlite.tar.gz 1>> $pylogloc 2>> $pylogloc
rm -rf sqlite 1>> $pylogloc 2>> $pylogloc
if [ $? -ne 0 ] ; then if [ $? -ne 0 ] ; then
echo -e "Failed to remove Sqlite install files. $pylogmsg" echo -e "Failed to remove Sqlite install files. $pylogmsg"
fi fi
@@ -94,17 +95,19 @@ fi
################################################################################ ################################################################################
echo -e "Installing Python" echo -e "Installing Python"
wget -O python.tar.gz $pylink 1> $pylogloc 2>> $pylogloc 3>> $pylogloc if [ ! -d python ] ; then
if [ $? -ne 0 ] ; then wget -O python.tar.gz $pylink 1> $pylogloc 2>> $pylogloc 3>> $pylogloc
if [ $? -ne 0 ] ; then
echo -e "Failed to fetch python, make sure wget is installed and $pylink is what you're after. $pylogmsg" echo -e "Failed to fetch python, make sure wget is installed and $pylink is what you're after. $pylogmsg"
exit 1 exit 1
fi fi
mkdir python mkdir python
tar xf python.tar.gz -C python --strip-components=1 1>> $pylogloc 2>> $pylogloc 3>> $pylogloc tar xf python.tar.gz -C python --strip-components=1 1>> $pylogloc 2>> $pylogloc 3>> $pylogloc
if [ $? -ne 0 ] ; then if [ $? -ne 0 ] ; then
echo -e "Failed to unzip python. $pylogmsg" echo -e "Failed to unzip python. $pylogmsg"
exit 1 exit 1
fi
fi fi
cd python cd python
@@ -152,7 +155,6 @@ fi
cd .. cd ..
rm python.tar.gz 1>> $pylogloc 2>> $pylogloc rm python.tar.gz 1>> $pylogloc 2>> $pylogloc
rm -rf python 1>> $pylogloc 2>> $pylogloc
if [ $? -ne 0 ] ; then if [ $? -ne 0 ] ; then
echo -e "Failed to remove Python install files. $pylogmsg" echo -e "Failed to remove Python install files. $pylogmsg"
fi fi

View File

@@ -9,18 +9,22 @@
# source vars # source vars
source vars source vars
# 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 # remove python
tput setaf 2 echo "Uninstalling Python"
echo "Uninstalling gunicorn" for dir in $(whereis python3 | tr " " "\n" | grep usr/local/bin | tr "\n" " ");
tput setaf 9 do rm -r $dir;
systemctl disable gunicorn 1> /dev/null 2> /dev/null done;
systemctl stop gunicorn 1> /dev/null 2> /dev/null
rm -f /etc/systemd/system/gunicorn.service # remove sqlite
echo "Uninstalling Sqlite3"
for dir in $(whereis sqlite3 | tr " " "\n" | grep usr/local/bin | tr "\n" " ");
do rm -r $dir;
done;

View File

@@ -12,7 +12,6 @@ echo "Disabling nginx"
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
# remove python # remove python
echo "Uninstalling Python" echo "Uninstalling Python"
for dir in $(whereis python3 | tr " " "\n" | grep usr/local/bin | tr "\n" " "); for dir in $(whereis python3 | tr " " "\n" | grep usr/local/bin | tr "\n" " ");