#!/bin/bash
echo $"Running command to install openssl, enter your root password"
su -c 'yum -y install openssl'
DIR="$( cd "$( dirname "$0" )" && pwd )/openvpn"
cd ~
echo ${DIR}
if [ ! -d "${DIR}" ] ; then
	echo $"Creating openvpn directory"
	mkdir "$DIR"
	echo $"Changing to openvpn directory"
	cd "$DIR"
fi
echo $"Getting AmahiHDAClient.crt"
wget http://dl.amahi.org/vpn/AmahiHDAClient.crt
echo $"Getting AmahiHDAClient.key"
wget http://dl.amahi.org/vpn/AmahiHDAClient.key
echo $"Getting ca-cert.crt"
wget http://dl.amahi.org/vpn/ca-cert.crt
echo $"Running command to make export file, enter amahi for the password"
openssl pkcs12 -export -in AmahiHDAClient.crt -inkey AmahiHDAClient.key -certfile ca-cert.crt -name Amahi -out certs.p12