wg-installer: fix using symlinks for conf files 17559/head
authorNick Hainke <vincent@systemli.org>
Mon, 10 Jan 2022 22:56:36 +0000 (23:56 +0100)
committerNick Hainke <vincent@systemli.org>
Mon, 10 Jan 2022 23:27:43 +0000 (00:27 +0100)
It is useful to symlink babeld and olsrd to /tmp/ if we frequently
write to those config files.

Signed-off-by: Nick Hainke <vincent@systemli.org>
net/wg-installer/Makefile
net/wg-installer/wg-server/hotplug.d/99-mesh-babeld
net/wg-installer/wg-server/hotplug.d/99-mesh-olsrd

index 00701701aadc3df8d46d4956f02395a496a5a9ba..55e654d651c564738cfa5a0e41c47e4d57996095 100644 (file)
@@ -54,7 +54,7 @@ endef
 
 define Package/wg-installer-server-hotplug-babeld
        $(call Package/wg-installer-server)
-       DEPENDS:=wg-installer-server
+       DEPENDS:=wg-installer-server +coreutils-dirname +coreutils-realpath
 endef
 
 define Package/wg-installer-server-hotplug-babeld/install
@@ -64,7 +64,7 @@ endef
 
 define Package/wg-installer-server-hotplug-olsrd
        $(call Package/wg-installer-server)
-       DEPENDS:=wg-installer-server
+       DEPENDS:=wg-installer-server +coreutils-dirname +coreutils-realpath
 endef
 
 define Package/wg-installer-server-hotplug-olsrd/install
index 068b199a18378cf1e5cc9f847c5c5c0d07ac23b5..4da7caa9145b278bf659bc13d4aebb916c1bb406 100644 (file)
@@ -14,7 +14,7 @@ fi
 if [ "${ACTION}" == "add" ]; then
        uci add babeld interface
        uci set babeld.@interface[-1].ifname="${INTERFACE}"
-       uci commit
+       uci -c "$(dirname $(realpath /etc/config/babeld))" commit babeld
        /etc/init.d/babeld reload
 fi
 
@@ -26,6 +26,6 @@ if [ "${ACTION}" == "remove" ]; then
                fi
                i=$((i+1));
        done
-       uci commit
+       uci -c "$(dirname $(realpath /etc/config/babeld))" commit babeld
        /etc/init.d/babeld reload
 fi
index 648ef6989da70b686b6b930a38bedc270d534f4f..1e4be369726a002feefb6f49a0275208672ef611 100644 (file)
@@ -16,7 +16,7 @@ if [ "${ACTION}" == "add" ]; then
        uci set olsrd.@Interface[-1].ignore=0
        uci set olsrd.@Interface[-1].interface="${INTERFACE}"
        uci set olsrd.@Interface[-1].Mode="ether"
-       uci commit
+       uci -c "$(dirname $(realpath /etc/config/olsrd))" commit olsrd
        /etc/init.d/olsrd reload
 fi
 
@@ -28,6 +28,6 @@ if [ "${ACTION}" == "remove" ]; then
                fi
                i=$((i+1));
        done
-       uci commit
+       uci -c "$(dirname $(realpath /etc/config/olsrd))" commit olsrd
        /etc/init.d/olsrd reload
 fi