...
 
Commits (26)
......@@ -4,6 +4,8 @@ PKG_NAME:=ffnw-hoods
PKG_VERSION:=1
PKG_RELEASE:=1
PKG_BUILD_DEPENDS := luci-base/host lua-cjson/host
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
include $(INCLUDE_DIR)/package.mk
......@@ -29,7 +31,8 @@ define Build/Compile
endef
define Package/$(PKG_NAME)/install
$(CP) ./files/* $(1)/
$(INSTALL_DIR) $(1)/lib/ffnw/hoods
lua -e 'local cjson = require("cjson"); print(cjson.encode(cjson.decode(assert(io.open("./files/lib/ffnw/hoods/hoods.json"):read("*a")))))' > $(1)/lib/ffnw/hoods/hoods.json
endef
$(eval $(call BuildPackage,$(PKG_NAME)))
......@@ -40,12 +40,12 @@
{
"host": "lk-st01.sn.ffnw.de",
"port": "10000",
"publickey": "ba21772b6f858fcbdf897121ced4bb3c277721f640dda9743166252cc66278f2"
"publickey": "c6485ba100d633dbebdbfad24ba4a010a242d6d7bb9817173259e9d3677b929d"
},
{
"host": "lk-st02.sn.ffnw.de",
"port": "10001",
"publickey": "4d1eb91cb01aeb3ef16b61ac77832f29b8e190ff6ace9253bc060427675f86bc"
"publickey": "88991ed1d7c6c4e1ffa9c97a1aa390d8ac03917ddacd9494c949abcbea6c6c94"
}
],
"boxes": [
......@@ -70,6 +70,11 @@
"host": "lk-fri01.sn.ffnw.de",
"port": "10001",
"publickey": "613ffbc8a5a2b1a8602866c0bd44afddecee79c49cde52ee4dd5df73c88d0437"
},
{
"host": "lk-fri02.sn.ffnw.de",
"port": "10002",
"publickey": "14f33c20c3487904e6d1420e9105cfb62b66bc3216d5cdb8a055461b6ed0415d"
}
],
"boxes": [
......@@ -120,12 +125,12 @@
"defaulthood": false,
"servers": [
{
"host": "lk-os-01.sn.ffnw.de",
"host": "lk-os01.sn.ffnw.de",
"port": "10000",
"publickey": "148fa1af96a0ee6653d150fa11b6b018738a711f47b8d8bb05ad569880ad6415"
},
{
"host": "lk-os-02.sn.ffnw.de",
"host": "lk-os02.sn.ffnw.de",
"port": "10001",
"publickey": "c91a74b295f8d1372080c0a7536b094631c4cab6af3fd339e135c4f971c91242"
}
......@@ -142,5 +147,140 @@
]
]
]
},
{
"name": "butjadingen",
"bssid": "02:00:0A:12:B0:00",
"defaulthood": false,
"servers": [
{
"host": "lk-bra01.sn.ffnw.de",
"port": "10000",
"publickey": "e581343a5d17afc1c8c205424e00e26adef6c520ec54b6f462f962245e5b02cd"
},
{
"host": "lk-bra02.sn.ffnw.de",
"port": "10001",
"publickey": "f9940159383e953044102b3e1529f568dd068c3f34062177ef74d244e06f65ef"
}
],
"boxes": [
[
[
53.45,
8.18
],
[
53.63,
8.57
]
]
]
},
{
"name": "wittmund",
"bssid": "02:00:0A:12:B8:00",
"defaulthood": false,
"servers": [
{
"host": "lk-wtm01.sn.ffnw.de",
"port": "10000",
"publickey": "b57a979cc9ae698b4173b5b57b2b193e38de5cc423059023894965bba8458e45"
},
{
"host": "lk-wtm02.sn.ffnw.de",
"port": "10001",
"publickey": "29a241d64158bc51f01e44bc188e91e5b887985da3688a02ce12b33439e17053"
}
],
"boxes": [
[
[
53.5,
7.68
],
[
53.72,
7.85
]
]
]
},
{
"name": "rastede",
"bssid": "02:00:0A:12:A0:00",
"defaulthood": false,
"servers": [
{
"host": "ras01.sn.ffnw.de",
"port": "10000",
"publickey": "ca1b5487ffc20a1f90e0ac14e835d84ab9e52612b5ca62e073d0a13dad98775e"
}
],
"boxes": [
[
[
53.22,
8.09
],
[
53.36,
8.32
]
]
]
},
{
"name": "lk-vec",
"bssid": "02:00:0A:12:A8:00",
"defaulthood": false,
"servers": [
{
"host": "lk-vec01.sn.ffnw.de",
"port": "10002",
"publickey": "18e3fd453b3ed675e23ead15727b6989879db5c401a71e1a5c4744f86d473eea"
}
],
"boxes": [
[
[
52.63,
7.91
],
[
52.76,
8.67
]
]
]
},
{
"name": "Delmenhorst",
"bssid": "02:00:0A:12:C0:00",
"defaulthood": false,
"servers": [
{
"host": "del01.sn.ffnw.de",
"port": "10000",
"publickey": "a1180ec56590b7c2c9377c10e96c5af176ff7f64984af423115875dd72d9bac3"
},
{
"host": "del02.sn.ffnw.de",
"port": "10001",
"publickey": "22d9a5e6c1d91946e894065038a7bc73b9739daa19ee767fd789a3ce0da95f92"
}
],
"boxes": [
[
[
53,
8.3
],
[
53.22,
8.78
]
]
]
}
]
......@@ -6,24 +6,34 @@ PKG_RELEASE:=1
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
PKG_BUILD_DEPENDS += lua/host luci-base/host
include $(INCLUDE_DIR)/package.mk
define Package/$(PKG_NAME)
define Package/ffnw-hoodselector
SECTION:=networke
CATEGORY:=Freifunk Nordwest
TITLE:=Select the hoods depending on the geo coordinate
DEPENDS:=+lwtrace +ffnw-hoods +dkjson gluon-mesh-batman-adv-15 +gluon-mesh-vpn-fastd
endef
define Package/$(PKG_NAME)/description
define Package/ffnw-hoodselector/description
Select the hoods depending on the geo coordinates
endef
define SrcDiet
$(FIND) $(1) -type f | while read src; do \
if $(STAGING_DIR_HOST)/bin/lua $(STAGING_DIR_HOST)/bin/LuaSrcDiet \
--noopt-binequiv -o "$$$$src.o" "$$$$src"; \
then mv "$$$$src.o" "$$$$src"; fi; \
done
endef
define Build/Prepare
mkdir -p $(PKG_BUILD_DIR)
$(CP) ./luasrc/* $(PKG_BUILD_DIR)/
sed -e 's/--.*//' -e '/^$$$$/d' $(PKG_BUILD_DIR)/hoodselector > $(PKG_BUILD_DIR)/hoodselector-min
chmod +x $(PKG_BUILD_DIR)/hoodselector-min
$(call SrcDiet,$(PKG_BUILD_DIR),$(PKG_BUILD_DIR))
chmod +x -R $(PKG_BUILD_DIR)/
endef
define Build/Configure
......@@ -32,10 +42,10 @@ endef
define Build/Compile
endef
define Package/$(PKG_NAME)/install
define Package/ffnw-hoodselector/install
$(CP) ./files/* $(1)/
$(INSTALL_DIR) $(1)/usr/sbin
$(CP) $(PKG_BUILD_DIR)/hoodselector-min $(1)/usr/sbin/hoodselector
$(CP) $(PKG_BUILD_DIR)/hoodselector $(1)/usr/sbin/hoodselector
endef
$(eval $(call BuildPackage,$(PKG_NAME)))
$(eval $(call BuildPackage,ffnw-hoodselector))
* * * * * /usr/sbin/hoodselector
*/2 * * * * /usr/sbin/hoodselector