Extend check_gateway script
ensure that dhcp server is stopped or started depending on gw mode
This commit is contained in:
		
					parent
					
						
							
								30e221a63f
							
						
					
				
			
			
				commit
				
					
						6ec13b343f
					
				
			
		
					 1 changed files with 17 additions and 0 deletions
				
			
		|  | @ -31,4 +31,21 @@ OLD_STATE="$(cat $MESH/gw_mode)" | |||
|         # Restart DHCP server | ||||
|         /usr/sbin/service isc-dhcp-server start | ||||
|     fi | ||||
|     exit 0 | ||||
| done | ||||
| 
 | ||||
| if [ "$NEW_STATE" == "server" ]; then | ||||
|     /usr/sbin/service isc-dhcp-server status 2>&1> /dev/null | ||||
|     if [[ $? -ne 0 ]] | ||||
|     then | ||||
|         /usr/sbin/service isc-dhcp-server restart | ||||
|     fi | ||||
| fi | ||||
| if [ "$NEW_STATE" == "off" ]; then | ||||
|     /usr/sbin/service isc-dhcp-server status 2>&1> /dev/null | ||||
|     if [[ $? -eq 0 ]] | ||||
|     then | ||||
|         /usr/sbin/service isc-dhcp-server stop | ||||
|     fi | ||||
| fi | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 ohrensessel
				ohrensessel