diff --git a/net/wg-installer/Makefile b/net/wg-installer/Makefile index 1d8127105..9718b9c16 100644 --- a/net/wg-installer/Makefile +++ b/net/wg-installer/Makefile @@ -22,7 +22,7 @@ define Package/wg-installer-server $(call Package/wg-installer/Default) TITLE+= (server) MENU:=1 - DEPENDS+=+rpcd +uhttpd +uhttpd-mod-ubus + DEPENDS+=+rpcd +uhttpd +uhttpd-mod-ubus +coreutils-dirname endef define Package/wg-installer-server/install @@ -57,7 +57,7 @@ endef define Package/wg-installer-server-hotplug-babeld $(call Package/wg-installer-server) - DEPENDS:=wg-installer-server +coreutils-dirname +coreutils-realpath + DEPENDS:=wg-installer-server +coreutils-realpath endef define Package/wg-installer-server-hotplug-babeld/install @@ -67,7 +67,7 @@ endef define Package/wg-installer-server-hotplug-olsrd $(call Package/wg-installer-server) - DEPENDS:=wg-installer-server +coreutils-dirname +coreutils-realpath + DEPENDS:=wg-installer-server +coreutils-realpath endef define Package/wg-installer-server-hotplug-olsrd/install diff --git a/net/wg-installer/wg-server/lib/wg_functions.sh b/net/wg-installer/wg-server/lib/wg_functions.sh index 98f823324..56bec24c6 100644 --- a/net/wg-installer/wg-server/lib/wg_functions.sh +++ b/net/wg-installer/wg-server/lib/wg_functions.sh @@ -75,6 +75,9 @@ wg_register () { gw_key="/tmp/run/wgserver/${ifname}.key" gw_pub="/tmp/run/wgserver/${ifname}.pub" wg genkey | tee "$gw_key" | wg pubkey > "$gw_pub" + else + [ -d "$(dirname $gw_key)" ] || mkdir -p "$(dirname $gw_key)" + [ -f "$gw_key" ] || wg genkey | tee "$gw_key" | wg pubkey > "$gw_pub" fi wg_server_pubkey=$(cat "$gw_pub")