mirror of
				https://github.com/iiab/iiab.git
				synced 2025-03-09 15:40:17 +00:00 
			
		
		
		
	* keep the xscenet url * leave the amazon vpn called xscenet, and the service that connectes to it * extra tab character * the vars/default_vars.yml takes precedence over roles/openvpn/defaults/main.yml
		
			
				
	
	
		
			28 lines
		
	
	
	
		
			930 B
		
	
	
	
		
			Bash
		
	
	
		
			Executable file
		
	
	
	
	
			
		
		
	
	
			28 lines
		
	
	
	
		
			930 B
		
	
	
	
		
			Bash
		
	
	
		
			Executable file
		
	
	
	
	
#!/bin/bash
 | 
						|
 | 
						|
export LC_ALL=C
 | 
						|
 | 
						|
#INTERFACE=$1 # The interface which is brought up or down
 | 
						|
#STATUS=$2 # The new state of the interface
 | 
						|
 | 
						|
# whenever interface is brought up by NM (rhbz #565921)
 | 
						|
if [ "$2" = "up" ]; then
 | 
						|
    # wait a few seconds to allow interface startup to complete
 | 
						|
    # (important at boot time without this the service still fails
 | 
						|
    # time-out for dispatcher script is 3s (rhbz#1003695#8)
 | 
						|
    sleep 2
 | 
						|
    /sbin/ip route list dev "$1" | grep -q '^default' &&
 | 
						|
    # restart the services
 | 
						|
    systemctl -q is-enabled openvpn@xscenet.service && /usr/lib/iiab/up-wan
 | 
						|
fi
 | 
						|
 | 
						|
# we added this to prevent logs from filling with openvpn errors
 | 
						|
#  but we do not expect openvpn to be on in that case
 | 
						|
#if [ "$2" = "down" ]; then
 | 
						|
#    sleep 2
 | 
						|
#    /sbin/ip route list dev "$1" | grep -q '^default' ||
 | 
						|
    # stop the services
 | 
						|
#    systemctl -q is-enabled openvpn@xscenet.service && systemctl stop openvpn@xscenet.service
 | 
						|
#fi
 | 
						|
 | 
						|
exit 0
 |