23 lines
		
	
	
		
			477 B
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
		
		
			
		
	
	
			23 lines
		
	
	
		
			477 B
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
| 
								 | 
							
								#!/usr/bin/env watchman
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								privoxy_username='privoxy'
							 | 
						||
| 
								 | 
							
								privoxy_configfile='/etc/privoxy/config'
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								service_command='/usr/bin/privoxy'
							 | 
						||
| 
								 | 
							
								service_pidfile='/run/privoxy.pid'
							 | 
						||
| 
								 | 
							
								service_args="--pidfile ${service_pidfile} --user ${privoxy_username} ${privoxy_configfile}"
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								privoxy::configtest() {
							 | 
						||
| 
								 | 
							
									"${service_command}" --config-test ${service_args}
							 | 
						||
| 
								 | 
							
								}
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								restart() {
							 | 
						||
| 
								 | 
							
									privoxy::configtest || {
							 | 
						||
| 
								 | 
							
										watchman.err "Config test failed, not restarting!"
							 | 
						||
| 
								 | 
							
										return 1
							 | 
						||
| 
								 | 
							
									}
							 | 
						||
| 
								 | 
							
									
							 | 
						||
| 
								 | 
							
									watchman.stop
							 | 
						||
| 
								 | 
							
									watchman.start
							 | 
						||
| 
								 | 
							
								}
							 |