|
|
@ -1,10 +1,12 @@ |
|
|
|
#!/bin/sh |
|
|
|
|
|
|
|
|
|
|
|
if [ -f "/etc/nginx/nginx.conf" ] && [ -f "/etc/nginx/ariang.conf" ]; then |
|
|
|
if [ -f "/etc/nginx/nginx.conf" ] && [ -f "/etc/nginx/conf.d/ariang.locations" ]; |
|
|
|
then |
|
|
|
if [ "$( grep 'server_name localhost;' < /etc/nginx/nginx.conf)" ] && |
|
|
|
[ ! "$( grep 'include ariang.conf;' < /etc/nginx/nginx.conf)" ]; then |
|
|
|
sed -i '/server_name localhost;/a \\t\tinclude ariang.conf;' /etc/nginx/nginx.conf |
|
|
|
[ ! "$( grep 'include conf.d/ariang.locations;' < /etc/nginx/nginx.conf)" ]; then |
|
|
|
sed -i '/server_name localhost;/\ |
|
|
|
a\\tinclude conf.d/ariang.locations;' /etc/nginx/nginx.conf |
|
|
|
if [ -f /var/run/nginx.pid ]; then |
|
|
|
/etc/init.d/nginx restart |
|
|
|
fi |
|
|
|