瀏覽代碼

bugfix: restored field comment in ROS cli

root 3 月之前
父節點
當前提交
ab1ccca04d
共有 2 個文件被更改,包括 5 次插入5 次删除
  1. 2 2
      scripts/sync_mikrotik.pl
  2. 3 3
      scripts/sync_mikrotik_poe_monitor.pl

+ 2 - 2
scripts/sync_mikrotik.pl

@@ -358,7 +358,7 @@ my $dns_name='';
 if ($leases{$ip}{dns_name}) { $dns_name = $leases{$ip}{dns_name}; }
 $dns_name =~s/\=//g;
 
-if ($dns_name) { $description = 'description="'.$dns_name." - ".$description.'"'; } else { $description = 'description="'.$description.'"'; }
+if ($dns_name) { $description = 'comment="'.$dns_name." - ".$description.'"'; } else { $description = 'comment="'.$description.'"'; }
 
 if (!exists $active_leases{$ip}) {
     db_log_verbose($dbh,$gate_ident."Address $ip not found in router. Create static lease record.");
@@ -443,7 +443,7 @@ if (@ret_hotspot and scalar(@ret_hotspot)) {
         if (!exists $actual_hotspot_bindings{$actual_mac}) {
             db_log_info($dbh,$gate_ident."Address $actual_mac added to hotspot ip-binding");
             push(@cmd_list,':foreach i in [/ip hotspot ip-binding find where mac-address='.uc($actual_mac).' ] do={/ip hotspot ip-binding remove $i};');
-            push(@cmd_list,'/ip hotspot ip-binding add mac-address='.uc($actual_mac).'  type=bypassed  description="'.$hotspot_exceptions{$actual_mac}.'"');
+            push(@cmd_list,'/ip hotspot ip-binding add mac-address='.uc($actual_mac).'  type=bypassed  comment="'.$hotspot_exceptions{$actual_mac}.'"');
             }
         }
     }

+ 3 - 3
scripts/sync_mikrotik_poe_monitor.pl

@@ -91,12 +91,12 @@ if (defined $work_list{$current_port}) {
     if ($work_list{$current_port}{ip} ne $current_list{$current_port}) {
         db_log_info($dbh,"Change settings poe monitor at $switch_name [$current_port] to ip: $work_list{$current_port}{ip}");
         push(@cmd_list,'/interface ethernet set [ find default-name='.$current_port.' ] power-cycle-ping-address='.$work_list{$current_port}{ip}.' power-cycle-ping-enabled=yes power-cycle-ping-timeout=5m'); 
-        push(@cmd_list,'/interface ethernet set [ find default-name='.$current_port.' ] description='.$work_list{$current_port}{dns_name}); 
+        push(@cmd_list,'/interface ethernet set [ find default-name='.$current_port.' ] comment='.$work_list{$current_port}{dns_name}); 
         }
     } else {
     db_log_info($dbh,"Disable poe monitor at $switch_name [$current_port]");
     push(@cmd_list,'/interface ethernet set [ find default-name='.$current_port.' ] power-cycle-ping-enabled=no');
-    push(@cmd_list,'/interface ethernet set [ find default-name='.$current_port.' ] description=""'); 
+    push(@cmd_list,'/interface ethernet set [ find default-name='.$current_port.' ] comment=""'); 
     }
 }
 
@@ -104,7 +104,7 @@ foreach my $work_port (keys %work_list) {
 if (!defined $current_list{$work_port}) {
     db_log_info($dbh,"Enable poe monitor at $switch_name [$work_port] for $work_list{$work_port}{ip}");
     push(@cmd_list,'/interface ethernet set [ find default-name='.$work_port.' ] power-cycle-ping-address='.$work_list{$work_port}{ip}.' power-cycle-ping-enabled=yes power-cycle-ping-timeout=5m');
-    push(@cmd_list,'/interface ethernet set [ find default-name='.$work_port.' ] description='.$work_list{$work_port}{dns_name});
+    push(@cmd_list,'/interface ethernet set [ find default-name='.$work_port.' ] comment='.$work_list{$work_port}{dns_name});
     }
 }