first ubuntu conversion

This commit is contained in:
ducoterra
2018-09-28 20:28:50 -04:00
parent 345ce7a859
commit 0fa8f5495d
2 changed files with 7 additions and 24 deletions

View File

@@ -4,7 +4,7 @@
################################################################################
# source vars
source ./vars
.vars
# check if root
if [[ $EUID -ne 0 ]]; then
@@ -21,12 +21,8 @@ if [ ! -d $logdir ] ; then
mkdir $logdir
fi
if [ $install_epel_release=True ] ; then
yum -y install epel-release 1>> $yumlogloc 2>> $yumlogloc 3>> $yumlogloc
fi
# install 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)
packages=(gcc wget nginx ufw sqlite3 bzip2 zlib1g-dev libffi-dev openssl)
for package in ${packages[@]};
do
echo -e "\tInstalling $package"
@@ -38,28 +34,16 @@ do
done
# firewall
ports=(80 443)
ports=(22 80 443)
for port in ${ports[@]};
do
echo -e "firewall-cmd --zone=public --add-port=$port/tcp --permanent" > $firelogloc
firewall-cmd --zone=public --add-port=$port/tcp --permanent 1>> $firelogloc 2>> $firelogloc
echo -e "ufw allow $port/tcp" > $firelogloc
ufw allow $port/tcp 1>> $firelogloc 2>> $firelogloc
if [ $? -ne 0 ] ; then
echo -e "\tfirewall failed to update port $port correctly (this may not be an issue). $firelogmsg"
fi
done
echo -e "firewall-cmd --reload" >> $firelogloc
firewall-cmd --reload 1>> $firelogloc 2>> $firelogloc
if [ $? -ne 0 ] ; then
echo -e "\tfirewall failed to reload, (this may not be an issue). $firelogmsg"
fi
echo -e "semanage permissive -a httpd_t" >> $firelogloc
semanage permissive -a httpd_t >> $firelogloc
if [ $? -ne 0 ] ; then
echo -e "semanage failed to set permissive. See $firelogmsg"
echo -e "\tfirewall failed to update port $port correctly. $firelogmsg"
exit 1
fi
done
################################################################################
# Python

1
vars
View File

@@ -5,7 +5,6 @@ export hostname=""
export usegit=False # if you have a django git project
export giturl="" # url for git project
export gitkey="" # IdentityFile
install_epel_release=False
# general install settings
export logdir="/var/log/djangosetup/"