mirror of
				https://github.com/optim-enterprises-bv/Mailu.git
				synced 2025-10-30 17:47:55 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			18 lines
		
	
	
		
			482 B
		
	
	
	
		
			Python
		
	
	
		
			Executable File
		
	
	
	
	
			
		
		
	
	
			18 lines
		
	
	
		
			482 B
		
	
	
	
		
			Python
		
	
	
		
			Executable File
		
	
	
	
	
| #!/usr/bin/python3
 | |
| 
 | |
| import jinja2
 | |
| import os
 | |
| import logging as log
 | |
| import sys
 | |
| 
 | |
| log.basicConfig(stream=sys.stderr, level=os.environ.get("LOG_LEVEL", "WARNING"))
 | |
| 
 | |
| def convert(src, dst):
 | |
|     logger = log.getLogger("convert()")
 | |
|     logger.debug("Source: %s, Destination: %s", src, dst)
 | |
|     open(dst, "w").write(jinja2.Template(open(src).read()).render(**os.environ))
 | |
| 
 | |
| convert("/unbound.conf", "/etc/unbound/unbound.conf")
 | |
| 
 | |
| os.execv("/usr/sbin/unbound", ["-c /etc/unbound/unbound.conf"])
 | 
