Current File : /home/inlingua/public_html/decay_sym/root/var/softaculous/apps/openssl11/build/make.sh
#!/bin/bash
source /var/softaculous/apps/build/common.sh

#Version
OPENSSL=openssl-1.1.1s
#OPENSSL=openssl-1.0.2u
version=1.1.1

is_file $AMPPS_PATH"/openssl-11/bin/openssl"
if [ $? == 0 ]
then
	banner "Installing openssl"
	cd $SRC_PATH
	remove_dir $OPENSSL
	
	if [ ! -s $SRC_PATH/$OPENSSL.tar.gz ]
	then
		banner $OPENSSL".tar.gz Downloading"
		wget --no-check-certificate -O	$SRC_PATH/$OPENSSL.tar.gz https://ftp.openssl.org/source/old/$version/$OPENSSL.tar.gz  >> $LOG 2>&1
	fi

	if [ ! -s $SRC_PATH/$OPENSSL.tar.gz ]
	then
		unlink $SRC_PATH/$OPENSSL.tar.gz
		banner $OPENSSL".tar.gz Downloading"
		wget --no-check-certificate -O	$SRC_PATH/$OPENSSL.tar.gz https://www.openssl.org/source/$OPENSSL.tar.gz  >> $LOG 2>&1
	fi
	
	tar -zxf $OPENSSL.tar.gz
	cd $OPENSSL

	./config --prefix=$AMPPS_PATH/openssl-11 --openssldir=$AMPPS_PATH/etc/openssl-11 shared -Wl,-rpath=$AMPPS_PATH/openssl-11/lib --libdir=$AMPPS_PATH/openssl-11/lib  && make clean && make && make install >> $LOG 2>&1

	# --libdir=$AMPPS_PATH/lib
	
	wget --no-check-certificate -O $AMPPS_PATH/etc/openssl-11/cert.pem  https://curl.haxx.se/ca/cacert.pem >> $LOG 2>&1

fi

is_file $AMPPS_PATH"/openssl-11/bin/openssl"
if [ $? == 0 ]
then
	banner 'OpenSSL could not be installed due to some reason'
	exit 1
fi

is_file $AMPPS_PATH"/etc/openssl-11/cert.pem"
if [ $? == 0 ]
then
	banner 'OpenSSL could not be installed as cacert was not able to be downloaded'
	exit 1
fi