wg-installer: fix using symlinks for conf files
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:52:40 +0000 (00:52 +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>
(cherry picked from commit 5e8301d7dc154b27b03dc2c24c111e41bb897293)

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 a1c86f36fc38ba4b41908b522df5a3d6e547670c..ce729a90b1304b5c7524dda045e2f2b658c680b5 100644 (file)
@@ -50,7 +50,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
@@ -60,7 +60,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