fix: 10-wan script
This commit is contained in:
@@ -14,7 +14,6 @@ require_once("system.inc");
|
||||
// Read CARP event arguments
|
||||
$subsystem = !empty($argv[1]) ? $argv[1] : '';
|
||||
$type = !empty($argv[2]) ? $argv[2] : '';
|
||||
$primary_vhid = '1';
|
||||
|
||||
// Accept only MASTER/BACKUP events
|
||||
if (!in_array($type, ['MASTER', 'BACKUP'])) {
|
||||
@@ -29,7 +28,10 @@ if (!preg_match('/^[a-z0-9_]+@\S+$/i', $subsystem)) {
|
||||
}
|
||||
|
||||
// Only react to the primary VHID
|
||||
if (!preg_match('/@' . preg_quote($primary_vhid, '/') . '$/', $subsystem)) {
|
||||
list($vhid, $iface) = explode('@', $subsystem);
|
||||
$primary_vhid = '1'; //
|
||||
|
||||
if ($vhid !== $primary_vhid) {
|
||||
exit(0); // ignore events from other VHIDs
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user