PUBLICIP_PERIOD environment variable

This commit is contained in:
Quentin McGaw
2020-07-16 01:12:54 +00:00
parent 002ffacd35
commit 51af8d1ab0
6 changed files with 102 additions and 11 deletions

View File

@@ -137,10 +137,12 @@ func _main(background context.Context, args []string) int {
// wait for restartUnbound
go unboundLooper.Run(ctx, wg)
publicIPLooper := publicip.NewLooper(client, logger, fileManager, allSettings.System.IPStatusFilepath, uid, gid)
publicIPLooper := publicip.NewLooper(client, logger, fileManager, allSettings.System.IPStatusFilepath, allSettings.PublicIPPeriod, uid, gid)
restartPublicIP := publicIPLooper.Restart
setPublicIPPeriod := publicIPLooper.SetPeriod
go publicIPLooper.Run(ctx)
go publicIPLooper.RunRestartTicker(ctx)
setPublicIPPeriod(allSettings.PublicIPPeriod) // call after RunRestartTicker
tinyproxyLooper := tinyproxy.NewLooper(tinyProxyConf, firewallConf, allSettings.TinyProxy, logger, streamMerger, uid, gid)
restartTinyproxy := tinyproxyLooper.Restart