ariang: rename nginx configuration file 11217/head
authorPeter Stadler <peter.stadler@student.uibk.ac.at>
Sun, 2 Feb 2020 18:13:30 +0000 (19:13 +0100)
committerPeter Stadler <peter.stadler@student.uibk.ac.at>
Sun, 2 Feb 2020 19:19:27 +0000 (20:19 +0100)
This makes the ariang-nginx ready for Nginx using the conf.d directory.

Signed-off-by: Peter Stadler <peter.stadler@student.uibk.ac.at>
net/ariang/Makefile
net/ariang/files/80_ariang-nginx-support
net/ariang/files/ariang.conf [deleted file]
net/ariang/files/ariang.locations [new file with mode: 0644]

index 1a7550466c9eb9439e5fcf0241f33833ed5f537c..48ff438cc9534c9960c8e4d2040770dfcfe3b447 100644 (file)
@@ -61,8 +61,8 @@ endef
 
 define Package/ariang-nginx/install
        $(Package/ariang/install)
-       $(INSTALL_DIR) $(1)/etc/nginx
-       $(INSTALL_BIN) ./files/ariang.conf $(1)/etc/nginx/ariang.conf
+       $(INSTALL_DIR) $(1)/etc/nginx/conf.d/
+       $(INSTALL_BIN) ./files/ariang.locations $(1)/etc/nginx/conf.d/
        $(INSTALL_DIR) $(1)/etc/uci-defaults
        $(INSTALL_BIN) ./files/80_ariang-nginx-support $(1)/etc/uci-defaults/80_ariang-nginx-support
 endef
index a9762e09bef0ac512bf63bf72d1d9da85a5ce61c..f3eea690f445a56b4191909bfb1cf1f191ca6837 100644 (file)
@@ -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
diff --git a/net/ariang/files/ariang.conf b/net/ariang/files/ariang.conf
deleted file mode 100644 (file)
index 28b0a8a..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-location /ariang {
-       index index.html;
-       alias /www/ariang/;
-}
\ No newline at end of file
diff --git a/net/ariang/files/ariang.locations b/net/ariang/files/ariang.locations
new file mode 100644 (file)
index 0000000..28b0a8a
--- /dev/null
@@ -0,0 +1,4 @@
+location /ariang {
+       index index.html;
+       alias /www/ariang/;
+}
\ No newline at end of file