Skip to content

Commit e6a7d74

Browse files
committed
Update ssl-conf.sh
1 parent 05de8ca commit e6a7d74

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

ssl-conf.sh

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,18 @@ fi
1212

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

2020
reload_apache2() {
21-
cp $1/httpd.conf.bak $1/httpd.conf
2221
cp $1/extra/httpd-vhosts.conf.bak $1/extra/httpd-vhosts.conf
23-
rm $1/httpd.conf.bak
22+
cp $1/extra/httpd-ssl.conf.bak $1/extra/httpd-ssl.conf
23+
cp $1/httpd.conf.bak $1/httpd.conf
24+
rm $1/extra/httpd-ssl.conf.bak
2425
rm $1/extra/httpd-vhosts.conf.bak
26+
rm $1/httpd.conf.bak
2527
echo "Starting webserver apache2 service"
2628
httpd -t
2729
}

0 commit comments

Comments
 (0)