Project

General

Profile

« Previous | Next » 

Revision 414edd3e

Added by Shahid Sheikh almost 12 years ago

#3174 Added handling of gateway groups in openvpn_restart

View differences:

etc/inc/openvpn.inc
790 790
	if (($mode == "client") && strstr($settings['interface'], "_vip") && (get_carp_interface_status($settings['interface']) == "BACKUP"))
791 791
		return;
792 792

  
793
    /* Check if client is bound to a gateway group */    
794
    $a_groups = return_gateway_groups_array();
795
    if (is_array($a_groups[$settings['interface']])) {
796
        /* the interface is a gateway group. If a vip is defined and its a CARP backup then do not start */
797
        if (($a_groups[$settings['interface']][0]['vip'] <> "") && (get_carp_interface_status($a_groups[$settings['interface']][0]['vip']) == "BACKUP"))
798
            return;
799
    }
800

  
793 801
	/* start the new process */
794 802
	$fpath = $g['varetc_path']."/openvpn/{$mode_id}.conf";
795 803
	openvpn_clear_route($mode, $settings);

Also available in: Unified diff