Skip to content

Commit

Permalink
Update ssl-conf.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
damalis committed May 31, 2022
1 parent 05de8ca commit e6a7d74
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions ssl-conf.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,18 @@ fi

use_lets_encrypt_certificates() {
echo "switching webserver to use Let's Encrypt certificate for $1"
sed -i 's/example.com/'$1'/g' $3/extra/httpd-ssl.conf
sed '/^#\(.*\)httpd-ssl\.conf/ s/^#//' $3/httpd.conf > $3/httpd.conf.bak
sed 's/#LoadModule/LoadModule/' $3/extra/httpd-vhosts.conf > $3/extra/httpd-vhosts.conf.bak
sed 's/example.com/'$1'/g' $3/extra/httpd-ssl.conf > $3/extra/httpd-ssl.conf.bak
sed '/^#\(.*\)httpd-ssl\.conf/ s/^#//' $3/httpd.conf > $3/httpd.conf.bak
}

reload_apache2() {
cp $1/httpd.conf.bak $1/httpd.conf
cp $1/extra/httpd-vhosts.conf.bak $1/extra/httpd-vhosts.conf
rm $1/httpd.conf.bak
cp $1/extra/httpd-ssl.conf.bak $1/extra/httpd-ssl.conf
cp $1/httpd.conf.bak $1/httpd.conf
rm $1/extra/httpd-ssl.conf.bak
rm $1/extra/httpd-vhosts.conf.bak
rm $1/httpd.conf.bak
echo "Starting webserver apache2 service"
httpd -t
}
Expand Down

0 comments on commit e6a7d74

Please sign in to comment.