Add wrappers that check the MODE in /etc/nut/nut.conf to avoid starting the daemons if nut is not configured (Closes: #747863).
This commit is contained in:
		
							parent
							
								
									fedf671e4d
								
							
						
					
					
						commit
						241119d464
					
				
					 6 changed files with 49 additions and 1 deletions
				
			
		
							
								
								
									
										19
									
								
								debian/local/upsd
									
										
									
									
										vendored
									
									
										Executable file
									
								
							
							
						
						
									
										19
									
								
								debian/local/upsd
									
										
									
									
										vendored
									
									
										Executable file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,19 @@
 | 
			
		|||
#!/bin/sh
 | 
			
		||||
 | 
			
		||||
# Include NUT nut.conf
 | 
			
		||||
[ -r /etc/nut/nut.conf ] && . /etc/nut/nut.conf
 | 
			
		||||
 | 
			
		||||
case "$MODE" in
 | 
			
		||||
  standalone|netserver)
 | 
			
		||||
    exec /lib/nut/upsd "$@"
 | 
			
		||||
  ;;
 | 
			
		||||
  none|netclient)
 | 
			
		||||
    echo "upsd disabled, please adjust the configuration to your needs"
 | 
			
		||||
    echo "Then set MODE to a suitable value in /etc/nut/nut.conf to enable it"
 | 
			
		||||
    # exit success to avoid breaking the install process!
 | 
			
		||||
    exit 0
 | 
			
		||||
  ;;
 | 
			
		||||
  *)
 | 
			
		||||
    exit 1
 | 
			
		||||
  ;;
 | 
			
		||||
esac
 | 
			
		||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue