interfaces: cleanup in linkup script

This commit is contained in:
Franco Fichtner 2022-11-09 10:05:11 +02:00
parent 83df36aefc
commit fc2c82ce4f

View File

@ -40,11 +40,11 @@ if ($argc < 3) {
exit;
}
function handle_argument_group($action, $realif)
function handle_argument_group($action, $device)
{
global $config;
$interface = convert_real_interface_to_friendly_interface_name($realif);
$interface = convert_real_interface_to_friendly_interface_name($device);
if (empty($interface)) {
return;
@ -60,20 +60,12 @@ function handle_argument_group($action, $realif)
switch ($action) {
case 'stop':
log_msg(sprintf(
"DEVD: Ethernet detached event for %s(%s)",
$interface,
$realif
), LOG_NOTICE);
log_msg(sprintf("DEVD: Ethernet detached event for %s(%s)", $interface, $device));
interface_bring_down($interface);
filter_configure(false, false);
break;
case 'start':
log_msg(sprintf(
"DEVD: Ethernet attached event for %s(%s)",
$interface,
$realif
), LOG_NOTICE);
log_msg(sprintf("DEVD: Ethernet attached event for %s(%s)", $interface, $device));
interface_configure(false, $interface, true, true);
filter_configure(false, false);
break;