commit dba3e08f387d996f4cd290cf8a83b554d3785e8f
parent c923fb97f431894ea85b3381520a2258afe4eb62
Author: Jan Pobříslo <ccx@te2000.cz>
Date: Wed, 2 Nov 2022 00:04:59 +0100
Define tinc networks using a table.
Diffstat:
3 files changed, 14 insertions(+), 4 deletions(-)
diff --git a/config.aat b/config.aat
@@ -80,4 +80,9 @@ id name
1000 ccx
]
+tinc_networks=[
+name
+ccx
+]
+
|}
diff --git a/s6-rc.aat b/s6-rc.aat
@@ -298,10 +298,15 @@
syncthing -logflags 0
|end()
-|start_longrun_with_logger("tinc.ccx", "net-all")
-|add_to_bundle("ok-all-but-tty", "tinc.ccx")
-|run_arg("tincd -n ccx -D -d")
+|if(find("tinc_networks.rows")) {
+@for i in tinc_networks
+|tinc_network = get("i.name")
+|start_longrun_with_logger("tinc." tinc_network, "net-all")
+|add_to_bundle("ok-all-but-tty", "tinc." tinc_network)
+|run_arg("tincd -n \"" tinc_network "\" -D -d")
|end()
+@endfor
+|}
|start_longrun_with_logger("wpa_supplicant", "modules\nok-sysinit")
|enabled_bundle("net-all")
diff --git a/s6-rc.fileset b/s6-rc.fileset
@@ -986,7 +986,7 @@ CN #!/command/execlineb -P
}
unexport SERVICE_PID
fdmove -c 2 1
- tincd -n ccx -D -d
+ tincd -n "ccx" -D -d
m755
/wpa_supplicant-log d m755