Skip to content

Commit

Permalink
Merge pull request #3039 from candlerb/candlerb/routeros-timestamp
Browse files Browse the repository at this point in the history
Remove "<timestamp> by RouterOS" comment lines from ROS v7
  • Loading branch information
robertcheramy authored Jan 26, 2024
2 parents 62ec6d3 + ad4a829 commit 0c7b529
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/oxidized/model/routeros.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,9 @@ class RouterOS < Oxidized::Model
cfg.gsub! "# poe-out status: short_circuit\r\n", '' # Remove intermittent POE short_circuit comment
cfg.gsub! "# Firmware upgraded successfully, please reboot for changes to take effect!\r\n", '' # Remove transient firmware upgrade comment
cfg.gsub! /# \S+ not ready\r\n/, '' # Remove intermittent $interface not ready comment
cfg = cfg.split("\n").reject { |line| line[/^#\s\w{3}\/\d{2}\/\d{4}\s\d{2}:\d{2}:\d{2}.*$/] || line[/^#\s\d{4}-\d{2}-\d{2}\s\d{2}:\d{2}:\d{2}.*$/] } # Remove date time and 'by RouterOS' comment
cfg = cfg.split("\n")
cfg.reject! { |line| line[/^#\s\w{3}\/\d{2}\/\d{4}.*$/] } # Remove date time and 'by RouterOS' comment (v6)
cfg.reject! { |line| line[/^#\s\d{4}-\d{2}-\d{2}.*$/] } # Remove date time and 'by RouterOS' comment (v7)
cfg.join("\n") + "\n"
end
end
Expand Down

0 comments on commit 0c7b529

Please sign in to comment.