Currently the uci-defaults script doesn't check if the rule is already present. This prevent any problem related by this. Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
15 lines
404 B
Bash
15 lines
404 B
Bash
#!/bin/sh
|
|
|
|
|
|
if [ -f "/etc/nginx/nginx.conf" ] && [ -f "/etc/nginx/ariang.conf" ]; 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
|
|
if [ -f /var/run/nginx.pid ]; then
|
|
/etc/init.d/nginx restart
|
|
fi
|
|
fi
|
|
fi
|
|
|
|
exit 0
|
|
|