因为工作需要将Fortigate的配置文件转换为HTML表格,写了几个Shell-script程序。上传到GitHub上了。
有兴趣的朋友可以去看看。
URL 如下:
https://github.com/ChoBon/Parse-fortigate-configuration-files
说明:
本程序可以将Fortigate的配置文件转换成两种类型的HTML文件,一种是嵌套式表格的;另一种是分立式表格的。
本程序在CentOS release 6.6 (Final)下运行通过。
共计8个Script文件。主文件是forti_cfg_parser.sh。这里的前提是所有Script文件都在相同Directory。
用法:
./forti_cfg_parser.sh fortigate_config_file output_nested_html_file output_isolated_html_file
这里, fortigate_config_file 是配置文件,
output_nested_html_file, 你指定的输出文件名,镶嵌式表格的HTML文件
output_isolated_html_file, 你指定的输出文件名,分立式表格的HTML文件
输入文件和输出文件与Script位于相同Directory。
用例:
./forti_cfg_parser.sh cfg1.txt cfg1-nested.html cfg1-isolated.html
这个命令行将 "cfg1.txt" 作为输入文件,输出两个HTML文件, cfg1-nested.html 和 cfg1-isolated.html 。