diff options
author | Ansuel Smith <ansuelsmth@gmail.com> | 2018-09-02 15:04:14 +0200 |
---|---|---|
committer | Ansuel Smith <ansuelsmth@gmail.com> | 2018-09-03 21:09:59 +0200 |
commit | 8245d6f071b70a41b1e86c00bfdbd41acb0f3979 (patch) | |
tree | de01e955a05207dab95656dc8fde952d49a8c2ae /net/ariang/files | |
parent | b5e6d2c7843b1f979732c6b4db5ddf229a126f8e (diff) |
ariang: fix nginx support script logic
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>
Diffstat (limited to 'net/ariang/files')
-rw-r--r-- | net/ariang/files/80_ariang-nginx-support | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/net/ariang/files/80_ariang-nginx-support b/net/ariang/files/80_ariang-nginx-support index bfe8862b2..a9762e09b 100644 --- a/net/ariang/files/80_ariang-nginx-support +++ b/net/ariang/files/80_ariang-nginx-support @@ -2,7 +2,8 @@ if [ -f "/etc/nginx/nginx.conf" ] && [ -f "/etc/nginx/ariang.conf" ]; then - if [ ! "$(cat '/etc/nginx/nginx.conf' | grep -q 'server_name localhost;')" ]; 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 @@ -11,3 +12,4 @@ if [ -f "/etc/nginx/nginx.conf" ] && [ -f "/etc/nginx/ariang.conf" ]; then fi exit 0 + |