fix issue with logs dir not being created
This commit is contained in:
14
install.sh
14
install.sh
@@ -3,28 +3,36 @@
|
|||||||
# Installs Dependencies automatically
|
# Installs Dependencies automatically
|
||||||
#TODO: 1. add success outputs to script
|
#TODO: 1. add success outputs to script
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|
||||||
|
# create necessary dirs
|
||||||
|
if [ ! -d "/root/scripts" ] ; then
|
||||||
mkdir scripts
|
mkdir scripts
|
||||||
|
fi
|
||||||
|
if [ ! -d "/root/logs" ] ; then
|
||||||
mkdir logs
|
mkdir logs
|
||||||
|
fi
|
||||||
|
|
||||||
# check if root
|
# check if root
|
||||||
if [[ $EUID -ne 0 ]]; then
|
if [[ $EUID -ne 0 ]]; then
|
||||||
echo "This script must be run as root"
|
echo "This script must be run as root"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
cd /root/
|
cd /root/
|
||||||
|
|
||||||
# yum update
|
# yum update
|
||||||
yum -y update > logs/additional.log
|
yum -y update > logs/yum.log
|
||||||
if [ $? -ne 0 ] ; then
|
if [ $? -ne 0 ] ; then
|
||||||
echo "yum failed to update, see logs/yum.log for more info"
|
echo "yum failed to update, see logs/yum.log for more info"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
# get epel-release
|
# get epel-release
|
||||||
yum -y install epel-release >> logs/additional.log
|
yum -y install epel-release >> logs/yum.log
|
||||||
if [ $? -ne 0 ] ; then
|
if [ $? -ne 0 ] ; then
|
||||||
echo "yum failed to install epel-release, see logs/yum.log for more info"
|
echo "yum failed to install epel-release, see logs/yum.log for more info"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
# install dependencies
|
# install dependencies
|
||||||
yum -y install vim nano 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 0:2.5-22.el7 >> logs/additional.log
|
yum -y install vim nano 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 >> logs/yum.log
|
||||||
if [ $? -ne 0 ] ; then
|
if [ $? -ne 0 ] ; then
|
||||||
echo "yum failed to install a dependency, see logs/yum.log for more info"
|
echo "yum failed to install a dependency, see logs/yum.log for more info"
|
||||||
exit 1
|
exit 1
|
||||||
|
|||||||
Reference in New Issue
Block a user