Skip to content
Snippets Groups Projects
Commit dbb5bc11 authored by Bjoern Franke's avatar Bjoern Franke
Browse files

add minimalistic script for registering fastd-keys

parent bc1ec6ba
No related branches found
No related tags found
No related merge requests found
include $(TOPDIR)/rules.mk
PKG_NAME:=ffol-fastdreg
PKG_VERSION:=1
PKG_RELEASE:=1
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
include $(INCLUDE_DIR)/package.mk
define Package/ffol-fastdreg
SECTION:=fastd
CATEGORY:=Freifunk Oldenburg
TITLE:=Adds script which registers fastd-key
DEPENDS:=+gluon-mesh-vpn-fastd
endef
define Package/ffol-fastdreg/description
Adds script which registers fastd-key
endef
define Build/Prepare
mkdir -p $(PKG_BUILD_DIR)
endef
define Build/Configure
endef
define Build/Compile
endef
define Package/ffol-fastdreg/install
$(CP) ./files/* $(1)/
endef
$(eval $(call BuildPackage,fastdreg))
#!/bin/sh
[ "$ACTION" = "ifup" -a "$INTERFACE" = "wan" ] && {
sleep 3
/lib/ffol/fastdreg.sh
}
#!/bin/sh
fastdenabled=$(uci get fastd.mesh_vpn.enabled)
fastdregdone=$(uci get fastd.regdone)
if [ $fastdenabled ] && [ ! $fastdregdone ]; then
/lib/ffol/fastdreg.sh
fi
#!/bin/sh
. /lib/functions.sh
keysrv="http://vpn.freifunk-ol.de"
hostname=$(uci get system.@system[0].hostname)
pubkey=$(/etc/init.d/fastd show_key mesh_vpn)
regdone=$(uci get fastd.regdone)
if [ -z $regdone ]; then
reg=$(wget -T15 "$keysrv/reg.php?name=$hostname&key=$pubkey" -O -)
if [ "$reg" == "regdone" ]; then
uci set fastd.regdone=1
fi
fi
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment