Commit 90d51b3d authored by Vitaly Lipatov's avatar Vitaly Lipatov

add script for fix nginx configs

parent e3608c31
#!/bin/sh
CONF="$1"
if grep -q ssl_trusted_certificate $CONF ; then
echo "ssl_trusted_certificate already in $CONF"
else
sed -i -e "s|\(.*\)\(ssl_certificate_key.*/etc/letsencrypt/live/\)\(.*\)\(/privkey.pem;.*\)|\1\2\3\4\n\1ssl_trusted_certificate /etc/letsencrypt/live/\3/chain.pem;|" $CONF
echo "fixed in $CONF"
fi
if grep -q "listen 443" $CONF ; then
if grep "listen 443 ssl httpd2;" $CONF ; then
echo "listen 443 ssl http2 already in $CONF"
else
sed -i -e "s|listen 443 ssl;|listen 443 ssl http2;|g" $CONF
fi
fi
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment