forked from remote/site-ffmuc
Move to utils folder, generate site-select makefile
This commit is contained in:
25
util/make_siteconfs.sh
Executable file
25
util/make_siteconfs.sh
Executable file
@@ -0,0 +1,25 @@
|
||||
#!/bin/sh
|
||||
|
||||
[ -e new ] || mkdir new
|
||||
|
||||
cat makefile_prefix > new/Makefile-site-select
|
||||
|
||||
cat stadtteile_idx.txt|grep -e '^[^#]'|grep -v LK_|while IFS=, read nr id desc port prefix4; do cp ../extra/ffmuc.conf new/ffmuc_$id.conf; done
|
||||
cat stadtteile_idx.txt|grep -e '^[^#]'|grep LK_|while IFS=, read nr id desc port prefix4; do cp ../extra/ffmuc_umland.conf new/ffmuc_$id.conf; done
|
||||
|
||||
cat stadtteile_idx.txt | grep -e '^[^#]' \
|
||||
| while IFS=, read nr id desc seg_id port prefix4 prefix6 next_node4 next_node6; do (
|
||||
echo "# processing ffmuc_$id.conf";
|
||||
cat new/ffmuc_$id.conf | sed -e "s/port 100[01][0-9]/port $port/" \
|
||||
| sed -e "s/.*site_code.*/ site_code = 'ffmuc_$id',/g" \
|
||||
| sed -e "s/.*site_name.*/ site_name = 'Freifunk München - $desc',/g" \
|
||||
| sed -e "s/.*ip4.*/ ip4 = '$next_node4',/g" \
|
||||
| sed -e "s@.*prefix4.*@ prefix4 = '$prefix4',@g" \
|
||||
| sed -e "s@.*prefix6.*@ prefix6 = '$prefix6',@g" \
|
||||
| sed -e "s/.ip6.*/ ip6 = '$next_node6',/g" > new/ffmuc_$id.conf.new;
|
||||
mv new/ffmuc_$id.conf.new new/ffmuc_$id.conf;
|
||||
echo " lua -e 'print(require(\"cjson\").encode(assert(loadfile(\"site_config.lua\")(\"\$(GLUON_SITEDIR)/extra/ffmuc_$id.conf\"))))' > \$(1)/lib/gluon/site-select/ffmuc_$id.json" >> new/Makefile-site-select
|
||||
); \
|
||||
done
|
||||
|
||||
cat makefile_suffix >> new/Makefile-site-select
|
||||
36
util/makefile_prefix
Normal file
36
util/makefile_prefix
Normal file
@@ -0,0 +1,36 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=gluon-config-mode-site-select
|
||||
PKG_VERSION:=0.2
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_BUILD_DEPENDS := lua-cjson/host
|
||||
|
||||
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
PKG_CONFIG_DEPENDS += $(GLUON_I18N_CONFIG)
|
||||
|
||||
define Package/gluon-config-mode-site-select
|
||||
SECTION:=gluon
|
||||
CATEGORY:=Gluon
|
||||
TITLE:=UI for changing the node-config
|
||||
endef
|
||||
|
||||
define Build/Prepare
|
||||
mkdir -p $(PKG_BUILD_DIR)
|
||||
endef
|
||||
|
||||
define Build/Configure
|
||||
endef
|
||||
|
||||
define Build/Compile
|
||||
$(call GluonBuildI18N,gluon-config-mode-site-select,i18n)
|
||||
endef
|
||||
|
||||
define Package/gluon-config-mode-site-select/install
|
||||
mkdir -p $(1)/etc/config/
|
||||
mkdir -p $(1)/lib/gluon/site-select/
|
||||
$(CP) ./files/* $(1)/
|
||||
|
||||
6
util/makefile_suffix
Normal file
6
util/makefile_suffix
Normal file
@@ -0,0 +1,6 @@
|
||||
DIR=$(1) sh create-config.sh
|
||||
|
||||
$(call GluonInstallI18N,gluon-config-mode-site-select,$(1))
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,gluon-config-mode-site-select))
|
||||
33
util/stadtteile_idx.txt
Normal file
33
util/stadtteile_idx.txt
Normal file
@@ -0,0 +1,33 @@
|
||||
#idx,id,description,segment_id,port,prefix4,prefix6,next_node4,next_node6
|
||||
1,M_Altstadt,Altstadt-Lehel,0,10021,10.80.132.0/22,fdef:ffc0:4fff:3::/64,10.80.132.1,fdef:ffc0:4fff:3::1
|
||||
2,M_Ludwigsvorstadt,Ludwigsvorstadt-Isarvorstadt,0,10022,10.80.164.0/22,fdef:ffc0:4fff:4::/64,10.80.164.1,fdef:ffc0:4fff:4::1
|
||||
3,M_Maxvorstadt,Maxvorstadt,0,10023,10.80.168.0/22,fdef:ffc0:4fff:5::/64,10.80.168.1,fdef:ffc0:4fff:5::1
|
||||
4,M_Schwabing_West,Schwabing-West,0,10024,10.80.200.0/22,fdef:ffc0:4fff:6::/64,10.80.200.1,fdef:ffc0:4fff:6::1
|
||||
5,M_Au,Au-Haidhausen,0,10025,10.80.136.0/22,fdef:ffc0:4fff:7::/64,10.80.136.1,fdef:ffc0:4fff:7::1
|
||||
6,M_Sendling,Sendling,0,10026,10.80.212.0/22,fdef:ffc0:4fff:8::/64,10.80.212.1,fdef:ffc0:4fff:8::1
|
||||
7,M_Sendl_Westpark,Sendling-Westpark,0,10027,10.80.208.0/22,fdef:ffc0:4fff:9::/64,10.80.208.1,fdef:ffc0:4fff:9::1
|
||||
8,M_Schwanthalerhoehe,Schwanthalerhöhe,0,10028,10.80.204.0/22,fdef:ffc0:4fff:a::/64,10.80.204.1,fdef:ffc0:4fff:a::1
|
||||
9,M_Neuhausen,Neuhausen-Nymphenburg,0,10029,10.80.180.0/22,fdef:ffc0:4fff:b::/64,10.80.180.1,fdef:ffc0:4fff:b::1
|
||||
10,M_Moosach,Moosach,0,10030,10.80.176.0/22,fdef:ffc0:4fff:c::/64,10.80.176.1,fdef:ffc0:4fff:c::1
|
||||
11,M_Milbertshofen,Milbertshofen-Am-Hart,0,10031,10.80.172.0/22,fdef:ffc0:4fff:d::/64,10.80.172.1,fdef:ffc0:4fff:d::1
|
||||
12,M_Schwabing_Freimann,Schwabing-Freimann,0,10032,10.80.196.0/22,fdef:ffc0:4fff:e::/64,10.80.196.1,fdef:ffc0:4fff:e::1
|
||||
13,M_Bogenhausen,Bogenhausen,0,10033,10.80.148.0/22,fdef:ffc0:4fff:f::/64,10.80.148.1,fdef:ffc0:4fff:f::1
|
||||
14,M_BergAmLaim,Berg am Laim,0,10034,10.80.144.0/22,fdef:ffc0:4fff:10::/64,10.80.144.1,fdef:ffc0:4fff:10::1
|
||||
15,M_Trudering,Trudering-Riem,0,10035,10.80.220.0/22,fdef:ffc0:4fff:11::/64,10.80.220.1,fdef:ffc0:4fff:11::1
|
||||
16,M_Ramersdorf,Ramersdorf-Perlach,0,10036,10.80.192.0/22,fdef:ffc0:4fff:12::/64,10.80.192.1,fdef:ffc0:4fff:12::1
|
||||
17,M_Giesing,Giesing,0,10037,10.80.184.0/22,fdef:ffc0:4fff:13::/64,10.80.184.1,fdef:ffc0:4fff:13::1
|
||||
18,M_Thalkirchen,Thalkirchen-Obersendling-Forstenried-Fürstenried-Solln,0,10039,10.80.216.0/22,fdef:ffc0:4fff:15::/64,10.80.216.1,fdef:ffc0:4fff:15::1
|
||||
29,M_Hadern,Hadern,0,10040,10.80.156.0/22,fdef:ffc0:4fff:16::/64,10.80.156.1,fdef:ffc0:4fff:16::1
|
||||
20,M_Pasing,Pasing-Obermenzing,0,10041,10.80.188.0/22,fdef:ffc0:4fff:17::/64,10.80.188.1,fdef:ffc0:4fff:17::1
|
||||
21,M_Aubing,Aubing-Lochhausen-Langwied,0,10042,10.80.140.0/22,fdef:ffc0:4fff:18::/64,10.80.140.1,fdef:ffc0:4fff:18::1
|
||||
22,M_Allach,Allach-Untermenzing,0,10043,10.80.128.0/22,fdef:ffc0:4fff:19::/64,10.80.128.1,fdef:ffc0:4fff:19::1
|
||||
23,M_Feldmoching,Feldmoching-Hasenbergl,0,10044,10.80.152.0/22,fdef:ffc0:4fff:1a::/64,10.80.152.1,fdef:ffc0:4fff:1a::1
|
||||
24,M_Laim,Laim,0,10045,10.80.160.0/22,fdef:ffc0:4fff:1b::/64,10.80.160.1,fdef:ffc0:4fff:1b::1
|
||||
25,LK_M_Land,München-Land,1,10046,10.80.24.0/21,fdef:ffc0:4fff:1c::/64,10.80.24.1,fdef:ffc0:4fff:1c::1
|
||||
26,LK_STA,Landkreis Starnberg (STA),1,10047,10.80.0.0/21,fdef:ffc0:4fff:1d::/64,10.80.0.1,fdef:ffc0:4fff:1d::1
|
||||
27,LK_FFB,Landkreis Fürstenfeldbruck (FFB),1,10048,10.80.232.0/21,fdef:ffc0:4fff:1e::/64,10.80.232.1,fdef:ffc0:4fff:1e::1
|
||||
28,LK_DAH,Landkreis Dachau (DAH),1,10049,10.80.248.0/21,fdef:ffc0:4fff:1f::/64,10.80.248.1,fdef:ffc0:4fff:1f::1
|
||||
39,LK_FS,Landkreis Freising (FS),1,10050,10.80.224.0/21,fdef:ffc0:4fff:20::/64,10.80.224.1,fdef:ffc0:4fff:20::1
|
||||
30,LK_ED,Landkreis Erding (ED),1,10061,10.80.16.0/21,fdef:ffc0:4fff:21::/64,10.80.16.1,fdef:ffc0:4fff:21::1
|
||||
31,LK_EBE,Landkreis Ebersberg (EBE),1,10062,10.80.240.0/21,fdef:ffc0:4fff:22::/64,10.80.240.1,fdef:ffc0:4fff:22::1
|
||||
32,LK_TOEL,Landkreis Bad Tölz-Wolfratshausen (TÖL),1,10063,10.80.8.0/21,fdef:ffc0:4fff:23::/64,10.80.8.1,fdef:ffc0:4fff:23::1
|
||||
Reference in New Issue
Block a user