{"id":11,"date":"2025-08-19T00:25:50","date_gmt":"2025-08-19T00:25:50","guid":{"rendered":"https:\/\/www.gizmo421.info\/?page_id=11"},"modified":"2025-08-19T01:26:47","modified_gmt":"2025-08-19T01:26:47","slug":"rb-gen","status":"publish","type":"page","link":"https:\/\/www.gizmo421.info\/index.php\/rb-gen\/","title":{"rendered":"rb gen"},"content":{"rendered":"\n<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n    <meta charset=\"UTF-8\">\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n    <title>MikroTik Script Customizer<\/title>\n    <!-- Tailwind CSS CDN -->\n    <script src=\"https:\/\/cdn.tailwindcss.com\"><\/script>\n    <!-- Google Font: Inter -->\n    <link href=\"https:\/\/fonts.googleapis.com\/css2?family=Inter:wght@400;500;600;700&#038;display=swap\" rel=\"stylesheet\">\n    <style>\n        body {\n            font-family: 'Inter', sans-serif;\n        }\n        \/* Custom scrollbar for consistency if needed, though Tailwind generally handles well *\/\n        .scrollable-content::-webkit-scrollbar {\n            width: 8px;\n        }\n        .scrollable-content::-webkit-scrollbar-track {\n            background: #f1f1f1;\n            border-radius: 10px;\n        }\n        .scrollable-content::-webkit-scrollbar-thumb {\n            background: #888;\n            border-radius: 10px;\n        }\n        .scrollable-content::-webkit-scrollbar-thumb:hover {\n            background: #555;\n        }\n    <\/style>\n<\/head>\n<body class=\"min-h-screen bg-gray-100 p-6 flex flex-col items-center justify-center antialiased\">\n\n    <div class=\"bg-white p-8 rounded-lg shadow-xl w-full max-w-4xl border border-gray-200\">\n        <h1 class=\"text-3xl font-bold text-gray-800 mb-6 text-center\">\n            MikroTik Script Editor \u2728\n        <\/h1>\n\n        <!-- Introduction for pre-loaded script -->\n        <div class=\"mb-8 p-4 bg-blue-50 border border-blue-200 rounded-md text-center\">\n            <p class=\"text-lg font-medium text-blue-700 mb-2\">\n                Your custom MikroTik script is ready!\n            <\/p>\n            <p class=\"text-sm text-gray-600\">\n                Modify the parameters below to instantly generate and download your personalized script.\n            <\/p>\n        <\/div>\n\n        <!-- Variable Input Section Container -->\n        <div id=\"variable-input-section\" class=\"mb-8 p-6 bg-purple-50 border border-purple-200 rounded-md\">\n            <h2 class=\"text-2xl font-semibold text-purple-800 mb-4\">\n                Adjust Script Parameters\n            <\/h2>\n            <p class=\"text-sm text-purple-600 mb-4\">\n                The application automatically identified configurable variables (e.g., `:set $variable_name &#8220;value&#8221;;`). Update their values and download your tailored script.\n            <\/p>\n            <div id=\"variable-fields-container\">\n                <!-- Variable input fields will be injected here by JavaScript -->\n            <\/div>\n            <button id=\"generate-script-btn\"\n                    class=\"mt-6 w-full bg-gradient-to-r from-green-500 to-green-600 text-white py-3 px-6 rounded-md\n                           text-lg font-semibold hover:from-green-600 hover:to-green-700 focus:outline-none\n                           focus:ring-2 focus:ring-green-500 focus:ring-offset-2 transition duration-200 ease-in-out\n                           transform hover:scale-105 shadow-md\">\n                Generate and Download Script\n            <\/button>\n        <\/div>\n\n        <div id=\"no-variables-message\" class=\"p-6 bg-white border border-gray-200 rounded-md shadow-inner text-center text-gray-600 hidden\">\n            <p class=\"text-lg\">\n                No variables were detected in the pre-loaded script. Please ensure variables are defined using `:set $variable_name &#8220;value&#8221;;` format.\n            <\/p>\n        <\/div>\n    <\/div>\n\n    <script>\n        \/\/ The MikroTik script provided by the user, pre-loaded into the app\n        const preloadedMikrotikScript = `\n#        -hh+\/\/ody\\\\\\`  mo \\\\\\`\/\/\/\/+md. yNy    \\\\\\`mN\/  +ds\/\/\/sd\/  :M. -\/\/\/\/sNo \\\\\\`Ms\/\/\/\/\/: \\\\\\`Ms\/++sh+\n#        \\\\\\`No      \\\\\\`  mo     -d+   ysd+   yom\/ +N.     .M\/ :M.     od-  \\\\\\`M\/       \\\\\\`M\/    \\\\\\`ms\n#        -M-   +ssy\/ mo   \\\\\\`sh.    ys\\\\\\`m: +h m\/ yd       ms :M.   -do    \\\\\\`Mhsssss- \\\\\\`M\/     yd\n#         dh\\\\\\`     hs mo  :d\/      ys -m:m\\\\\\` m\/ :N\/     \/N- :M. \\\\\\`sh.     \\\\\\`M\/       \\\\\\`M\/    :N\/\n#         +hysssys.  do +Nysssss\/ yo  +N-  d\/  .sysssys.  :N\\\\\\` dmssssss.\\\\\\`Nyssssss\\\\\\`\\\\\\`Nysssys-\n#  .-:----.                                                                                 .------.\n# oNNNNNNmmmddhyo+:-.                                                             -:\/+syddmmmNNNNNNm.\n# .sNMMMMMMMMMMMMMMNmds\/-                  gizmo@gizmo421.info               .:+ydmNMMMMMMMMMMMMMMd\/\n#   \/MMMMMMMMMMMMMMMMMMMNho-                                              .\/ymNMMMMMMMMMMMMMMMMMMh.\n#    yMMMMMMMMMMMMMMMMMMMMMNh\/   ....----...               ..-----..    .smMMMMMMMMMMMMMMMMMMMMMN.\n#    -MMMMMMMMMMMMMMMMMMMMMMMMhhddmmNNNNNNmddy+-.    .-\/ohdmmNNNNNNmddyyNMMMMMMMMMMMMMMMMMMMMMMMy\n#     dMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMmh+\/ydNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM\/\n#     yMMMMMMMMMMMMMMMMMMMMMMMMMMMNNmNNNNNMMMMMMMMMMMMMMMMMMNNNmNNNNMMMMMMMMMMMMMMMMMMMMMMMMMMMM.\n#     oMMMMMMMMMMMMMMMMMMMMMMMMNs:-...-..-\/+sdmNMMMMMMMNmyo\/:-...---:odMMMMMMMMMMMMMMMMMMMMMMMMM\n#     oMMMMMMMMMMMMMMMMMMMMMMMm\/              .:smNNNh+-               sNMMMMMMMMMMMMMMMMMMMMMMN\n#     -MMMMMMMMMMMMMMMMMMMMMMy.                   .-.                   :mMMMMMMMMMMMMMMMMMh\n#      sMMMMMMMMMMMMMMMMMMMN\/                                            .yMMMMMMMMMMMMMMMMMMN.\n#       yMMMMMMMMMMMMMMMMMh.                                               oNMMMMMMMMMMMMMMMMm-\n#        +NMMMMMMMMMMMMMN+           ...                      ....          -dMMMMMMMMMMMMMMh.\n#         -yMMMMMMMMMMMM\/     .\/shdNMMMMMNdy+.           :sdmMMMMMNmdy+:      dMMMMMMMMMMMm+\n#           -yNMMMMMMMMM.  -smMMMMMMMMMMNshNMMy.       \/mMMmyhMMMMMMMMMMNh+   yMMMMMMMMMm+\n#             .\/yNMMMMMM \/mMMdooMMMMMMMMM\/  dMM:       dMM\/  mMMMMMMMMm\/yNMNy.sMMMMMMdo-\n#                .MMMMMM yMMy  -MMMMMMMMM- :MMd        \/MMy  dMMMMMMMMh  -MMM-sMMMMMs\n#                .MMMMMM  dMMo  \/mMMMMMd\/ +NMm.         oMMh. yNMMMMNy  -dMM+ oMMMMMy\n#                .MMMMMM   sMMmo-.-\/\/\/\/\/smMNs            \/ymNhh+:\/+\/:..\/yNMm:  sMMMMMy\n#                .MMMMMM    -smMNNNmNNNMMdo.      ..       \/ymMNNNmmNNMNh+    oMMMMMs\n#                 MMMMMM       -\/ossso+:.     -smNNNNms-      -\/ossso+:.      oMMMMMs\n#                 MMMMMM                 -+syhNMMMMMMMMNyo\/:.                 sMMMMMs\n#                 MMMMMM               :dNMMMMMMMMMMMMMMMMMNNy:               sMMMMMo\n#                 MMMMMM              oNMMMMMMMMMMMMMMMMMMMMMMNy.             sMMMMMo\n#                 NMMMMM.            -NMMMMmsoshNMMMMMmhysyNMMMMo             yMMMMM+\n#                 mMMMMM-             \/dMMMmsy+:--\/+\/::\/syyMMMNo.             hMMMMM\/\n#                 hMMMMMy-              \/hNMMMMNmdhyhdNMMMMMms-             .+NMMMMM:\n#                 :NMMMMMNy\/-             -ohmNMMMMMMMMNmds:.            .:smMMMMMMh\n#                  :dMMMMMMMNds\/-.           .-:\/+o+++\/-.            -:ohmMMMMMMMmo\n#                    \/hNMMMMMMMMNmhs+:-..                     .-:\/shdNMMMMMMMMNd+.\n#                      .\/ymNMMMMMMMMMMNmdhhso\/\/:-..----:\/+oyhdmNMMMMMMMMMMNmh+-\n#                          -\/sdmNMMMMMMMMMMMMMMMMNNNNNMMMMMMMMMMMMMMMNmdy+:.\n#                               -\/oydmNNMMMMMMMMMMMMMMMMMMMMMMNNmdho\/:.\n#                                     .-\/+oyhdmmNNNNNNmmmdhs+\/:-\n#                                               ...--.\n#\n#\n#\n#\n# model = RouterBOARD 3011UiAS\n# serial number = 780F075BC48F\n# Section 0 Vars\n# sec 1 Interfaces\n# sec 2 networks\n# sec 3 firewall\n# sec 4 vpn\n# sec 5 scripts\n# sec 6 lockdown\n#\n#\n# +++Section0 Vars+++\n#\n#\n#\n# New Admin user Name\n:set $nadmin \"BSIT\";\n#\n# New Admin user Password\n:set $nadminpass \"Aszx@421\";\n#\n#New Admin User Comment\n:set $nadmincom \"Blue Space IT\";\n#\n# Device ID\n:set $devid [ \/system routerboard get serial-number ];\n#\n# RoMon ID\n:set $romonid [\/interface ethernet get [find where name=\"ether1\"] orig-mac-address];\n#\n# Device DNS\n:set $ddns \"8.8.8.8,8.8.4.4\";\n#\n# Device Time zone\n:set $dtzone \"America\/Chicago\";\n#\n# Device Winbox Port\n:set $winport \"8301\";\n#\n# LAN Interface List (No Spaces)\n:set $lanlist \"LAN\";\n#\n# WAN Interface List (No Spaces)\n:set $wanlist \"WAN\";\n#\n# WAN VLAN\n:set $wvlan \"926\";\n#\n# Network 1 LAN Name (used for Comments)\n:set $n1name \"Management Network\";\n#\n# Network 1 LAN Short Name (No Spaces)\n:set $n1sname \"MAN-NET\";\n#\n# Network 1 LAN VLAN\n:set $n1vlan \"626\";\n#\n# Network 1 LAN IP\n:set $n1ip \"10.10.0.1\";\n#\n# Network 1 LAN Network\n:set $n1network \"10.10.0.0\";\n#\n# Network 1 LAN Network Mask\n:set $n1mask \"23\";\n#\n# Network 1 LAN Gateway\n:set $n1gate \"10.10.0.1\";\n#\n# Network 1 DHCP Pool\n:set $n1pool \"10.10.1.1-10.10.1.254\";\n#\n# Network 1 LAN DNS\n:set $n1dns \"8.8.8.8,8.8.4.4\";\n#\n#\n# Network 2 LAN Name (used for Comments)\n:set $n2name \"VoIP Network\";\n#\n# Network 2 LAN Short Name (No Spaces)\n:set $n2sname \"VoIP-NET\";\n#\n# Network 2 LAN VLAN\n:set $n2vlan \"835\";\n#\n# Network 2 LAN IP\n:set $n2ip \"10.10.2.1\";\n#\n# Network 2 LAN Network\n:set $n2network \"10.10.2.0\";\n#\n# Network 2 LAN Network Mask\n:set $n2mask \"23\";\n#\n# Network 2 LAN Gateway\n:set $n2gate \"10.10.2.1\";\n#\n# Network 2 DHCP Pool\n:set $n2pool \"10.10.3.1-10.10.3.254\";\n#\n# Network 2 LAN DNS\n:set $n2dns \"8.8.8.8,8.8.4.4\";\n#\n#\n# Network 3 LAN Name (used for Comments)\n:set $n3name \"Office Network\";\n#\n# Network 3 LAN Short Name (No Spaces)\n:set $n3sname \"Office-NET\";\n#\n# Network 3 Wifi Name\n:set $n3ssidname \"Office\";\n#\n# Network 3 Wifi Password\n:set $n3ssidpwd \"Aszx0421\";\n#\n# Network 3 LAN VLAN\n:set $n3vlan \"633\";\n#\n# Network 3 LAN IP\n:set $n3ip \"10.10.4.1\";\n#\n# Network 3 LAN Network\n:set $n3network \"10.10.4.0\";\n#\n# Network 3 LAN Network Mask\n:set $n3mask \"23\";\n#\n# Network 3 LAN Gateway\n:set $n3gate \"10.10.4.1\";\n#\n# Network 3 DHCP Pool\n:set $n3pool \"10.10.5.1-10.10.5.254\";\n#\n# Network 3 LAN DNS\n:set $n3dns \"8.8.8.8,8.8.4.4\";\n#\n#\n# Network 4 LAN Name (used for Comments)\n:set $n4name \"CCTV Network\";\n#\n# Network 4 LAN Short Name (No Spaces)\n:set $n4sname \"CCTV-NET\";\n#\n# Network 4 LAN VLAN\n:set $n4vlan \"228\";\n#\n# Network 4 LAN IP\n:set $n4ip \"10.10.6.1\";\n#\n# Network 4 LAN Network\n:set $n4network \"10.10.6.0\";\n#\n# Network 4 LAN Network Mask\n:set $n4mask \"23\";\n#\n# Network 4 LAN Gateway\n:set $n4gate \"10.10.6.1\";\n#\n# Network 4 DHCP Pool\n:set $n4pool \"10.10.7.1-10.10.7.254\";\n#\n# Network 4 LAN DNS\n:set $n4dns \"8.8.8.8,8.8.4.4\";\n#\n#\n# Network 5 LAN Name (used for Comments)\n:set $n5name \"Guest Network\";\n#\n# Network 5 LAN Short Name (No Spaces)\n:set $n5sname \"Guest-NET\";\n#\n# Network 5 Wifi Name\n:set $n5ssidname \"Guest\";\n#\n# Network 5 Guest Username\n :set $n5user \"guest\";\n#\n# Network 5 Guest Password\n :set $n5upswd \"guest421\";\n#\n# Network 5 Guest SpeedLimit Rx\/Tx\n:set $n5ulimt \"1m\/5m\";\n#\n# Network 5 Guest MAX Users\n :set $n5umax \"200\";\n#\n# Network 5 LAN VLAN\n:set $n5vlan \"483\";\n#\n# Network 5 LAN IP\n:set $n5ip \"172.16.0.1\";\n#\n# Network 5 LAN Network\n:set $n5network \"172.16.0.0\";\n#\n# Network 5 LAN Network Mask\n:set $n5mask \"23\";\n#\n# Network 5 LAN Gateway\n:set $n5gate \"172.16.0.1\";\n#\n# Network 5 DHCP Pool\n:set $n5pool \"172.16.0.2-172.16.1.254\";\n#\n# Network 5 LAN DNS\n:set $n5dns \"195.46.39.39,195.46.39.40\";\n#\n#\n# Network 6 VPN Name (used for Comments)\n:set $n6name \"VPN Network\";\n#\n# Network 6 VPN Short Name (No Spaces)\n:set $n6sname \"VPN-NET\";\n#\n# Network 6 VPN IP\n:set $n6ip \"192.168.88.1\";\n#\n# Network 6 VPN Network\n:set $n6network \"192.168.88.0\";\n#\n# Network 6 VPN Network Mask\n:set $n6mask \"24\";\n#\n# Network 6 VPN Gateway\n:set $n6gate \"192.168.88.1\";\n#\n# Network 6 VPN DHCP Pool\n:set $n6pool \"192.168.88.2-192.168.88.254\";\n#\n# Network 6 VPN LAN DNS\n:set $n6dns \"8.8.8.8,8.8.4.4\";\n#\n# Network 6 VPN Username\n:set $vpnun \"BSIT\";\n#\n# Network 6 VPN Password\n:set $vpnpass \"Aszx@421\";\n#\n#\n#\n#\n#\n# Comment Prefix (Becuse I CAN!)\n:set $compfix \"BSIT-defconf:\";\n#\n#\n#####################################################################################################\n#####################################################################################################\n#                         Don't change anything below this line. Please!\n#####################################################################################################\n#####################################################################################################\n#\n#\n#\n# Lets Begin\n# Script Start LED Flash\n:local state0 [ \/system leds get value-name=type number=0 ]\n\/system leds set numbers=[ \/system leds find leds~\"sfp-sfpplus-led\" ] type=on\n:delay 10.0\n\/system leds set numbers=[ \/system leds find leds~\"sfp-sfpplus-led\" ] type=off\n:delay 0.2\n\/system leds set numbers=[ \/system leds find leds~\"sfp-sfpplus-led\" ] type=on\n:delay 0.2\n\/system leds set numbers=[ \/system leds find leds~\"sfp-sfpplus-led\" ] type=off\n:delay 0.2\n\/system leds set numbers=[ \/system leds find leds~\"sfp-sfpplus-led\" ] type=off\n:delay 0.2\n\/system leds set numbers=[ \/system leds find leds~\"sfp-sfpplus-led\" ] type=on\n:delay 0.2\n\/system leds set numbers=[ \/system leds find leds~\"sfp-sfpplus-led\" ] type=off\n:delay 0.2\n\/system leds set numbers=[ \/system leds find leds~\"sfp-sfpplus-led\" ] type=on\n:delay 0.2\n\/system leds set numbers=[ \/system leds find leds~\"sfp-sfpplus-led\" ] type=off\n:delay 0.2\n\/system leds set numbers=[ \/system leds find leds~\"sfp-sfpplus-led\" ] type=off\n:delay 0.2\n\/system leds set numbers=[ \/system leds find leds~\"sfp-sfpplus-led\" ] type=on\n:delay 0.2\n\/system leds set numbers=[ \/system leds find leds~\"sfp-sfpplus-led\" ] type=off\n:delay 0.2\n\/system leds set numbers=[ \/system leds find leds~\"sfp-sfpplus-led\" ] type=on\n:delay 0.2\n\/system leds set numbers=[ \/system leds find leds~\"sfp-sfpplus-led\" ] type=off\n:delay 0.2\n\/system leds set numbers=[ \/system leds find leds~\"sfp-sfpplus-led\" ] type=off\n:delay 0.2\n\/system leds set numbers=[ \/system leds find leds~\"sfp-sfpplus-led\" ] type=on\n:delay 0.2\n\/system leds set numbers=[ \/system leds find leds~\"sfp-sfpplus-led\" ] type=off\n:delay 3.0\n#\n# +++Section1 Interfaces+++\n#\n# Blink Once Notice\n\/system leds set numbers=[ \/system leds find leds~\"sfp-sfpplus-led\" ] type=on\n:delay 1.0\n\/system leds set numbers=[ \/system leds find leds~\"sfp-sfpplus-led\" ] type=off\n:delay 5.0\n#\n\/interface ethernet\nset [ find default-name=ether1 ] comment=\"$compfix $wanlist Network\" disabled=no\nset [ find default-name=ether2 ] comment=\"$compfix To Core Switch Un-tagged Traffic Only\" disabled=no\nset [ find default-name=ether3 ] comment=\"$compfix $wanlist Network Test Port\" disabled=no\nset [ find default-name=ether4 ] comment=\"$compfix $n3name Test Port\" disabled=no\nset [ find default-name=ether5 ] comment=\"$compfix $n2name Test Port\" disabled=no\nset [ find default-name=ether6 ] comment=\"$compfix $n5name Test Port\" disabled=no\nset [ find default-name=ether7 ] comment=\"$compfix $n4name Test Port\" disabled=no\nset [ find default-name=ether8 ] comment=\"$compfix Not Used\" disabled=yes\nset [ find default-name=ether9 ] comment=\"$compfix Not Used\" disabled=yes\nset [ find default-name=ether10 ] comment=\"$compfix $n1name Port\" disabled=no\nset [ find default-name=sfp-sfpplus1 ] comment=\"$compfix NOT Used\" disabled=yes\n#\n\/interface bridge\nadd comment=\"$compfix Main Bridge\" name=bridge priority=0 vlan-filtering=yes\n#\n\/interface bridge port\nadd bridge=bridge comment=\"$compfix $wanlist Network\" frame-types=admit-only-untagged-and-priority-tagged interface=ether1 pvid=\"$wvlan\"\nadd bridge=bridge comment=\"$compfix To Core Switch Untaged Traffice Only\" interface=ether2\nadd bridge=bridge comment=\"$compfix $wanlist Network Test Port\" frame-types=admit-only-untagged-and-priority-tagged interface=ether3 pvid=\"$wvlan\"\nadd bridge=bridge comment=\"$compfix $n3name Test Port\" frame-types=admit-only-untagged-and-priority-tagged interface=ether4 pvid=\"$n3vlan\"\nadd bridge=bridge comment=\"$compfix $n2name Test Port\" frame-types=admit-only-untagged-and-priority-tagged interface=ether5 pvid=\"$n2vlan\"\nadd bridge=bridge comment=\"$compfix $n5name Test Port\" frame-types=admit-only-untagged-and-priority-tagged interface=ether6 pvid=\"$n5vlan\"\nadd bridge=bridge comment=\"$compfix $n4name Test Port\" frame-types=admit-only-untagged-and-priority-tagged interface=ether7 pvid=\"$n4vlan\"\nadd bridge=bridge comment=\"$compfix $n1name Port\" frame-types=admit-only-untagged-and-priority-tagged interface=ether10 pvid=\"$n1vlan\"\n#\n\/interface bridge vlan\nadd bridge=bridge comment=\"$compfix $wanlist Network\" tagged=bridge,ether2 untagged=ether1,ether3 vlan-ids=\"$wvlan\"\nadd bridge=bridge comment=\"$compfix $n1name\" tagged=bridge,ether2 untagged=ether10 vlan-ids=\"$n1vlan\"\nadd bridge=bridge comment=\"$compfix $n2name\" tagged=bridge,ether2 untagged=ether5 vlan-ids=\"$n2vlan\"\nadd bridge=bridge comment=\"$compfix $n3name\" tagged=bridge,ether2 untagged=ether4 vlan-ids=\"$n3vlan\"\nadd bridge=bridge comment=\"$compfix $n4name\" tagged=bridge,ether2 untagged=ether7 vlan-ids=\"$n4vlan\"\nadd bridge=bridge comment=\"$compfix $n5name\" tagged=bridge,ether2 untagged=ether6 vlan-ids=\"$n5vlan\"\n#\n\/interface vlan\nadd comment=\"$compfix $n1name\" interface=bridge name=\"vlan$n1vlan\" vlan-id=$n1vlan\nadd comment=\"$compfix $n2name\" interface=bridge name=\"vlan$n2vlan\" vlan-id=$n2vlan\nadd comment=\"$compfix $n3name\" interface=bridge name=\"vlan$n3vlan\" vlan-id=$n3vlan\nadd comment=\"$compfix $n4name\" interface=bridge name=\"vlan$n4vlan\" vlan-id=$n4vlan\nadd comment=\"$compfix $n5name\" interface=bridge name=\"vlan$n5vlan\" vlan-id=$n5vlan\nadd comment=\"$compfix $wanlist Network\" interface=bridge name=\"vlan$wvlan\" vlan-id=$wvlan\n#\n\/interface list\nadd comment=\"$compfix $wanlist Interfaces\" name=\"$wanlist\"\nadd comment=\"$compfix $lanlist Interfaces\" name=\"$lanlist\"\nadd comment=\"$compfix Interfaces that are not for router Access\" name=\"NOT-$n1sname\"\nadd comment=\"$compfix $n1name Interfaces\" name=\"$n1sname\"\n#\n\/interface list member\nadd comment=\"$compfix $n1name\" interface=\"vlan$n1vlan\" list=\"$lanlist\"\nadd comment=\"$compfix $n2name\" interface=\"vlan$n2vlan\" list=\"$lanlist\"\nadd comment=\"$compfix $n3name\" interface=\"vlan$n3vlan\" list=\"$lanlist\"\nadd comment=\"$compfix $n4name\" interface=\"vlan$n4vlan\" list=\"$lanlist\"\nadd comment=\"$compfix $n5name\" interface=\"vlan$n5vlan\" list=\"$lanlist\"\nadd comment=\"$compfix $n2name\" interface=\"vlan$n2vlan\" list=\"NOT-$n1sname\"\nadd comment=\"$compfix $n4name\" interface=\"vlan$n4vlan\" list=\"NOT-$n1sname\"\nadd comment=\"$compfix $n5name\" interface=\"vlan$n5vlan\" list=\"NOT-$n1sname\"\nadd comment=\"$compfix $n3name\" interface=\"vlan$n3vlan\" list=\"NOT-$n1sname\"\nadd comment=\"$compfix $wanlist Network\" interface=\"vlan$wvlan\" list=\"NOT-$n1sname\"\nadd comment=\"$compfix $wanlist Network\" interface=\"vlan$wvlan\" list=\"$wanlist\"\nadd comment=\"$compfix $n1name\" interface=\"vlan$n1vlan\" list=\"$n1sname\"\n#\n\/interface detect-internet\nset detect-interface-list=\"$wanlist\" internet-interface-list=\"$wanlist\" lan-interface-list=\"$lanlist\" wan-interface-list=\"$wanlist\"\n#\n#\n#\n#\n# +++Section2 Networks+++\n#\n# Blink Twice Notice\n\/system leds set numbers=[ \/system leds find leds~\"sfp-sfpplus-led\" ] type=on\n:delay 1.0\n\/system leds set numbers=[ \/system leds find leds~\"sfp-sfpplus-led\" ] type=off\n:delay 1.0\n\/system leds set numbers=[ \/system leds find leds~\"sfp-sfpplus-led\" ] type=on\n:delay 1.0\n\/system leds set numbers=[ \/system leds find leds~\"sfp-sfpplus-led\" ] type=off\n:delay 5.0\n#\n\/ip dns\nset servers=$ddns\n#\n\/ip dhcp-client\nadd comment=\"$compfix $wanlist Network DHCP Client\" interface=\"vlan$wvlan\" disabled=no\n#\n\/ip address\nadd address=\"$n1ip\/$n1mask\" comment=\"$compfix $n1name\" interface=\"vlan$n1vlan\"\nadd address=\"$n2ip\/$n2mask\" comment=\"$compfix $n2name\" interface=\"vlan$n2vlan\"\nadd address=\"$n3ip\/$n3mask\" comment=\"$compfix $n3name\" interface=\"vlan$n3vlan\"\nadd address=\"$n4ip\/$n4mask\" comment=\"$compfix $n4name\" interface=\"vlan$n4vlan\"\nadd address=\"$n5ip\/$n5mask\" comment=\"$compfix $n5name\" interface=\"vlan$n5vlan\"\n#\n\/ip pool\nadd comment=\"$compfix $n1name DHCP Server Pool\" name=\"$n1sname-dhcp-pool\" ranges=\"$n1pool\"\nadd comment=\"$compfix $n2name DHCP Server Pool\" name=\"$n2sname-dhcp-pool\" ranges=\"$n2pool\"\nadd comment=\"$compfix $n3name DHCP Server Pool\" name=\"$n3sname-dhcp-pool\" ranges=\"$n3pool\"\nadd comment=\"$compfix $n4name DHCP Server Pool\" name=\"$n4sname-dhcp-pool\" ranges=\"$n4pool\"\nadd comment=\"$compfix $n5name DHCP Server Pool\" name=\"$n5sname-dhcp-pool\" ranges=\"$n5pool\"\nadd comment=\"$compfix $n6name DHCP Server Pool\" name=\"$n6sname-dhcp-pool\" ranges=\"$n6pool\"\n#\n\/ip dhcp-server\nadd address-pool=\"$n1sname-dhcp-pool\" disabled=no interface=\"vlan$n1vlan\" name=\"$n1sname-dhcp-server\"\nadd address-pool=\"$n2sname-dhcp-pool\" disabled=no interface=\"vlan$n2vlan\" name=\"$n2sname-dhcp-server\"\nadd address-pool=\"$n3sname-dhcp-pool\" disabled=no interface=\"vlan$n3vlan\" name=\"$n3sname-dhcp-server\"\nadd address-pool=\"$n4sname-dhcp-pool\" disabled=no interface=\"vlan$n4vlan\" name=\"$n4sname-dhcp-server\"\nadd address-pool=\"$n5sname-dhcp-pool\" disabled=no interface=\"vlan$n5vlan\" name=\"$n5sname-dhcp-server\"\n#\n\/ip dhcp-server network\nadd address=\"$n1network\/$n1mask\" comment=\"$compfix $n1name\" dns-server=\"$n1dns\" gateway=\"$n1gate\" netmask=\"$n1mask\"\nadd address=\"$n2network\/$n2mask\" comment=\"$compfix $n2name\" dns-server=\"$n2dns\" gateway=\"$n2gate\" netmask=\"$n2mask\"\nadd address=\"$n3network\/$n3mask\" comment=\"$compfix $n3name\" dns-server=\"$n3dns\" gateway=\"$n3gate\" netmask=\"$n3mask\"\nadd address=\"$n4network\/$n4mask\" comment=\"$compfix $n4name\" dns-server=\"$n4dns\" gateway=\"$n4gate\" netmask=\"$n4mask\"\nadd address=\"$n5network\/$n5mask\" comment=\"$compfix $n5name\" dns-server=\"$n5dns\" gateway=\"$n5gate\" netmask=\"$n5mask\"\n#\n\/caps-man channel\nadd band=5ghz-n\/ac comment=\"$compfix 5.2Ghz Channel\" control-channel-width=20mhz \\\n    frequency=5180 name=5g\nadd band=2ghz-g\/n comment=\"$compfix 2.4Ghz Channel\" control-channel-width=20mhz \\\n    frequency=2412 name=2g\n\/caps-man datapath\nadd client-to-client-forwarding=yes comment=\"$compfix $n3name DataPath\" \\\n    local-forwarding=yes name=\"$n3sname\" vlan-id=\"$n3vlan\" vlan-mode=use-tag\nadd client-to-client-forwarding=yes comment=\"$compfix $n5name DataPath\" \\\n    local-forwarding=yes name=\"$n5sname\" vlan-id=\"$n5vlan\" vlan-mode=use-tag\n\/caps-man security\nadd comment=\"$compfix $n5name SSID Passphrase\" name=\"$n5sname\"\nadd authentication-types=wpa2-psk comment=\"$compfix $n3name SSID Passphrase\" \\\n    encryption=aes-ccm group-encryption=aes-ccm name=\"$n3sname\" passphrase=$n3ssidpwd\n\/caps-man configuration\nadd channel=2g country=\"united states3\" datapath=\"$n5sname\" mode=ap name=\"$n5sname-2g\" security=\"$n5sname\" ssid=$n5ssidname\nadd channel=5g country=\"united states3\" datapath=\"$n5sname\" mode=ap name=\"$n5sname-5g\" security=\"$n5sname\" ssid=$n5ssidname\nadd channel=2g country=\"united states3\" datapath=\"$n3sname\" mode=ap name=\"$n3sname-2g\" security=\"$n3sname\" ssid=$n3ssidname\nadd channel=5g country=\"united states3\" datapath=\"$n3sname\" mode=ap name=\"$n3sname-5g\" security=\"$n3sname\" ssid=$n3ssidname\n\/caps-man access-list\nadd action=accept allow-signal-out-of-range=10s comment=\"$compfix Good Signal Accept\" disabled=no interface=any signal-range=-80..120 ssid-regexp=\"\"\nadd action=reject allow-signal-out-of-range=10s comment=\"$compfix Weak Signal Drop\" disabled=no interface=any signal-range=-120..-81 ssid-regexp=\"\"\n\/caps-man manager\nset ca-certificate=auto certificate=auto enabled=yes\n\/caps-man manager interface\nset [ find default=yes ] forbid=yes\nadd disabled=no interface=\"vlan$n1vlan\"\n\/caps-man provisioning\nadd action=create-dynamic-enabled comment=\"$compfix 2.4Ghz Provisioning Templet\" \\\n    hw-supported-modes=gn master-configuration=\"$n3sname-2g\" \\\n    name-format=identity slave-configurations=\"$n5sname-2g\"\nadd action=create-dynamic-enabled comment=\"$compfix 5.2Ghz Provisioning Templet\" \\\n    hw-supported-modes=ac master-configuration=\"$n3sname-5g\" \\\n    name-format=identity slave-configurations=\"$n5sname-5g\"\n#\n\/ip hotspot profile\nadd dns-name=home.com hotspot-address=\"$n5ip\" name=hotspot-server-profile\n\/ip hotspot\nadd address-pool=\"$n5sname-dhcp-pool\" addresses-per-mac=1 disabled=no interface=\\\n    \"vlan$n5vlan\" name=hotspot-server profile=hotspot-server-profile\n\/ip hotspot user profile\nset [ find default=yes ] address-pool=\"$n5sname-dhcp-pool\" name=user-profile \\\n    rate-limit=$n5ulimt shared-users=$n5umax\n\/ip hotspot service-port\nset ftp disabled=yes\n\/ip hotspot user\nadd comment=\"$compfix $n5name User Account for HotSpot\" name=\"$n5user\" password=\"$n5upswd\" \\\n    server=hotspot-server\n#\n#\n#\n#\n# +++Section3 Firewall+++\n#\n# Blink Three Times Notice for section 3\n\/system leds set numbers=[ \/system leds find leds~\"sfp-sfpplus-led\" ] type=on\n:delay 1.0\n\/system leds set numbers=[ \/system leds find leds~\"sfp-sfpplus-led\" ] type=off\n:delay 1.0\n\/system leds set numbers=[ \/system leds find leds~\"sfp-sfpplus-led\" ] type=on\n:delay 1.0\n\/system leds set numbers=[ \/system leds find leds~\"sfp-sfpplus-led\" ] type=off\n:delay 1.0\n\/system leds set numbers=[ \/system leds find leds~\"sfp-sfpplus-led\" ] type=on\n:delay 1.0\n\/system leds set numbers=[ \/system leds find leds~\"sfp-sfpplus-led\" ] type=off\n:delay 5.0\n#\n\/ip firewall filter\nadd action=drop chain=input comment=\"$compfix Drop new connections from blacklisted IP's to this router\" connection-state=new src-address-list=blacklist\nadd action=drop chain=forward comment=\"$compfix Drop new connections to blacklisted IP's from this router\" connection-state=new dst-address-list=blacklist\nadd action=accept chain=input comment=\"$compfix Winbox from $wanlist\" dst-port=\"$winport\" in-interface-list=\"$wanlist\" protocol=tcp src-address-list=!blacklist\nadd action=drop chain=input comment=\"$compfix Winbox from $n1name\" dst-port=\"$winport\" in-interface-list=\"NOT-$n1sname\" protocol=tcp\nadd action=accept chain=input comment=\"$compfix defconf: accept established,related,untracked\" connection-state=established,related,untracked\nadd action=accept chain=input comment=\"$compfix allow IPsec NAT\" disabled=yes dst-port=4500 protocol=udp\nadd action=accept chain=input comment=\"$compfix allow IKE\" disabled=yes dst-port=500 protocol=udp\nadd action=accept chain=input comment=\"$compfix allow l2tp\" disabled=yes dst-port=1701 protocol=udp\nadd action=accept chain=input comment=\"$compfix allow pptp\" disabled=yes dst-port=1723 protocol=tcp\nadd action=accept chain=input comment=\"$compfix allow sstp\" disabled=yes dst-port=443 protocol=tcp\nadd action=drop chain=input comment=\"$compfix defconf: drop invalid\" connection-state=invalid\nadd action=accept chain=input comment=\"$compfix defconf: accept ICMP\" in-interface-list=\"!$wanlist\" protocol=icmp\nadd action=drop chain=input comment=\"$compfix defconf: drop all not coming from LAN\" in-interface-list=\"!$lanlist\"\nadd action=accept chain=forward comment=\"$compfix defconf: accept in ipsec policy\" disabled=yes ipsec-policy=in,ipsec\nadd action=accept chain=forward comment=\"$compfix defconf: accept out ipsec policy\" disabled=yes ipsec-policy=out,ipsec\nadd action=accept chain=forward comment=\"$compfix defconf: accept established,related, untracked\" connection-state=established,related,untracked\nadd action=drop chain=forward comment=\"$compfix defconf: drop invalid\" connection-state=invalid\nadd action=drop chain=forward comment=\"$compfix drop all from WAN not DSTNATed\" connection-nat-state=!dstnat connection-state=new in-interface-list=\"$wanlist\"\nadd action=passthrough chain=unused-hs-chain comment=\"$compfix Cross Network Blocks Below From $n1name\" disabled=yes\nadd action=drop chain=forward comment=\"$compfix Block from $n1name to $n2name\" dst-address=\"$n2network\/$n2mask\" src-address=\"$n1network\/$n1mask\"\nadd action=drop chain=forward comment=\"$compfix Block from $n1name to $n3name\" dst-address=\"$n3network\/$n3mask\" src-address=\"$n1network\/$n1mask\"\nadd action=drop chain=forward comment=\"$compfix Block from $n1name to $n4name\" dst-address=\"$n4network\/$n4mask\" src-address=\"$n1network\/$n1mask\"\nadd action=drop chain=forward comment=\"$compfix Block from $n1name to $n5name\" dst-address=\"$n5network\/$n5mask\" src-address=\"$n1network\/$n1mask\"\nadd action=drop chain=forward comment=\"$compfix Block from $n1name to $n6name\" dst-address=\"$n6network\/$n6mask\" src-address=\"$n1network\/$n1mask\"\nadd action=passthrough chain=unused-hs-chain comment=\"$compfix Cross Network Blocks Below From $n2name\" disabled=yes\nadd action=drop chain=forward comment=\"$compfix Block from $n2name to $n1name\" dst-address=\"$n1network\/$n1mask\" src-address=\"$n2network\/$n2mask\"\nadd action=drop chain=forward comment=\"$compfix Block from $n2name to $n3name\" dst-address=\"$n3network\/$n3mask\" src-address=\"$n2network\/$n2mask\"\nadd action=drop chain=forward comment=\"$compfix Block from $n2name to $n4name\" dst-address=\"$n4network\/$n4mask\" src-address=\"$n2network\/$n2mask\"\nadd action=drop chain=forward comment=\"$compfix Block from $n2name to $n5name\" dst-address=\"$n5network\/$n5mask\" src-address=\"$n2network\/$n2mask\"\nadd action=drop chain=forward comment=\"$compfix Block from $n2name to $n6name\" dst-address=\"$n6network\/$n6mask\" src-address=\"$n2network\/$n2mask\"\nadd action=passthrough chain=unused-hs-chain comment=\"$compfix Cross Network Blocks Below From $n3name\" disabled=yes\nadd action=drop chain=forward comment=\"$compfix Block from $n3name to $n1name\" dst-address=\"$n1network\/$n1mask\" src-address=\"$n3network\/$n3mask\"\nadd action=drop chain=forward comment=\"$compfix Block from $n3name to $n2name\" dst-address=\"$n2network\/$n2mask\" src-address=\"$n3network\/$n3mask\"\nadd action=drop chain=forward comment=\"$compfix Block from $n3name to $n4name\" dst-address=\"$n4network\/$n4mask\" src-address=\"$n3network\/$n3mask\"\nadd action=drop chain=forward comment=\"$compfix Block from $n3name to $n5name\" dst-address=\"$n5network\/$n5mask\" src-address=\"$n3network\/$n3mask\"\nadd action=drop chain=forward comment=\"$compfix Block from $n3name to $n6name\" dst-address=\"$n6network\/$n6mask\" src-address=\"$n3network\/$n3mask\"\nadd action=passthrough chain=unused-hs-chain comment=\"$compfix Cross Network Blocks Below From $n4name\" disabled=yes\nadd action=drop chain=forward comment=\"$compfix Block from $n4name to $n1name\" dst-address=\"$n1network\/$n1mask\" src-address=\"$n4network\/$n4mask\"\nadd action=drop chain=forward comment=\"$compfix Block from $n4name to $n2name\" dst-address=\"$n2network\/$n2mask\" src-address=\"$n4network\/$n4mask\"\nadd action=drop chain=forward comment=\"$compfix Block from $n4name to $n3name\" dst-address=\"$n3network\/$n3mask\" src-address=\"$n4network\/$n4mask\"\nadd action=drop chain=forward comment=\"$compfix Block from $n4name to $n5name\" dst-address=\"$n5network\/$n5mask\" src-address=\"$n4network\/$n4mask\"\nadd action=drop chain=forward comment=\"$compfix Block from $n4name to $n6name\" dst-address=\"$n6network\/$n6mask\" src-address=\"$n4network\/$n4mask\"\nadd action=passthrough chain=unused-hs-chain comment=\"$compfix Cross Network Blocks Below From $n5name\" disabled=yes\nadd action=drop chain=forward comment=\"$compfix Block from $n5name to $n1name\" dst-address=\"$n1network\/$n1mask\" src-address=\"$n5network\/$n5mask\"\nadd action=drop chain=forward comment=\"$compfix Block from $n5name to $n2name\" dst-address=\"$n2network\/$n2mask\" src-address=\"$n5network\/$n5mask\"\nadd action=drop chain=forward comment=\"$compfix Block from $n5name to $n3name\" dst-address=\"$n3network\/$n3mask\" src-address=\"$n5network\/$n5mask\"\nadd action=drop chain=forward comment=\"$compfix Block from $n5name to $n4name\" dst-address=\"$n4network\/$n4mask\" src-address=\"$n5network\/$n5mask\"\nadd action=drop chain=forward comment=\"$compfix Block from $n5name to $n6name\" dst-address=\"$n6network\/$n6mask\" src-address=\"$n5network\/$n5mask\"\nadd action=passthrough chain=unused-hs-chain comment=\"$compfix Cross Network Blocks Below From $n6name\" disabled=yes\nadd action=drop chain=forward comment=\"$compfix Block from $n6name to $n1name\" dst-address=\"$n1network\/$n1mask\" src-address=\"$n6network\/$n6mask\"\nadd action=drop chain=forward comment=\"$compfix Block from $n6name to $n2name\" dst-address=\"$n2network\/$n2mask\" src-address=\"$n6network\/$n6mask\"\nadd action=drop chain=forward comment=\"$compfix Block from $n6name to $n3name\" dst-address=\"$n3network\/$n3mask\" src-address=\"$n6network\/$n6mask\"\nadd action=drop chain=forward comment=\"$compfix Block from $n6name to $n4name\" dst-address=\"$n4network\/$n4mask\" src-address=\"$n6network\/$n6mask\"\nadd action=drop chain=forward comment=\"$compfix Block from $n6name to $n5name\" dst-address=\"$n5network\/$n5mask\" src-address=\"$n6network\/$n6mask\"\n#\n\/ip firewall nat\nadd action=masquerade chain=srcnat comment=\"$compfix gizmoized-defconf: masquerade\" out-interface-list=\"$wanlist\"\nadd action=masquerade chain=srcnat comment=\"$compfix masq. vpn traffic\" src-address=\"$n6network\/$n6mask\"\n#\n#\n#\n#\n# +++Section4 VPN+++\n#\n# Blink four times Notice foe section 4\n\/system leds set numbers=[ \/system leds find leds~\"sfp-sfpplus-led\" ] type=on\n:delay 1.0\n\/system leds set numbers=[ \/system leds find leds~\"sfp-sfpplus-led\" ] type=off\n:delay 1.0\n\/system leds set numbers=[ \/system leds find leds~\"sfp-sfpplus-led\" ] type=on\n:delay 1.0\n\/system leds set numbers=[ \/system leds find leds~\"sfp-sfpplus-led\" ] type=off\n:delay 1.0\n\/system leds set numbers=[ \/system leds find leds~\"sfp-sfpplus-led\" ] type=on\n:delay 1.0\n\/system leds set numbers=[ \/system leds find leds~\"sfp-sfpplus-led\" ] type=off\n:delay 1.0\n\/system leds set numbers=[ \/system leds find leds~\"sfp-sfpplus-led\" ] type=on\n:delay 1.0\n\/system leds set numbers=[ \/system leds find leds~\"sfp-sfpplus-led\" ] type=off\n:delay 5.0\n#\n\/ppp profile\nset *FFFFFFFE local-address=\"$n6ip\" remote-address=\"$n6sname-dhcp-pool\"\n\/interface l2tp-server server\nset enabled=yes ipsec-secret=\"$vpnpass\" use-ipsec=yes\n\/interface pptp-server server\nset enabled=yes\n\/interface sstp-server server\nset default-profile=default-encryption enabled=yes\n\/ppp secret\nadd comment=\"$compfix VPN User\" name=\"$vpnun\" password=\"$vpnpass\"\n#\n#\n#\n#\n# +++Section5 Scripts+++\n#\n# Blink Five Times Notice for section 5\n\/system leds set numbers=[ \/system leds find leds~\"sfp-sfpplus-led\" ] type=on\n:delay 1.0\n\/system leds set numbers=[ \/system leds find leds~\"sfp-sfpplus-led\" ] type=off\n:delay 1.0\n\/system leds set numbers=[ \/system leds find leds~\"sfp-sfpplus-led\" ] type=on\n:delay 1.0\n\/system leds set numbers=[ \/system leds find leds~\"sfp-sfpplus-led\" ] type=off\n:delay 1.0\n\/system leds set numbers=[ \/system leds find leds~\"sfp-sfpplus-led\" ] type=on\n:delay 1.0\n\/system leds set numbers=[ \/system leds find leds~\"sfp-sfpplus-led\" ] type=off\n:delay 1.0\n\/system leds set numbers=[ \/system leds find leds~\"sfp-sfpplus-led\" ] type=on\n:delay 1.0\n\/system leds set numbers=[ \/system leds find leds~\"sfp-sfpplus-led\" ] type=off\n:delay 1.0\n\/system leds set numbers=[ \/system leds find leds~\"sfp-sfpplus-led\" ] type=on\n:delay 1.0\n\/system leds set numbers=[ \/system leds find leds~\"sfp-sfpplus-led\" ] type=off\n:delay 5.0\n#\n# Spam Net\n\/system scheduler\nadd comment=\"$compfix Download spamnaus list\" interval=3d name=DownloadSpamhausList \\\n    on-event=DownloadSpamhaus policy=\\\n    ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon \\\n    start-date=jan\/01\/1970 start-time=12:46:47\nadd comment=\"$compfix Apply spamnaus List\" interval=3d name=InstallSpamhausList \\\n    on-event=ReplaceSpamhaus policy=\\\n    ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon \\\n    start-date=jan\/01\/1970 start-time=12:51:47\nadd comment=\"$compfix Download dshield list\" interval=3d name=DownloadDShieldList \\\n    on-event=Download_dshield policy=\\\n    ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon \\\n    start-date=jan\/01\/1970 start-time=12:56:47\nadd comment=\"$compfix Apply dshield List\" interval=3d name=InstallDShieldList \\\n    on-event=Replace_dshield policy=\\\n    ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon \\\n    start-date=jan\/01\/1970 start-time=13:01:47\nadd comment=\"$compfix Download malc0de list\" interval=3d name=Downloadmalc0deList \\\n    on-event=Download_malc0de policy=\\\n    ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon \\\n    start-date=jan\/01\/1970 start-time=12:56:47\nadd comment=\"$compfix Apply malc0de List\" interval=3d name=Installmalc0deList \\\n    on-event=Replace_malc0de policy=\\\n    ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon \\\n    start-date=jan\/01\/1970 start-time=13:01:47\n\/system script\nadd comment=\"$compfix Download spamnaus list\" dont-require-permissions=no name=\\\n    DownloadSpamhaus owner=ccp421 policy=\\\n    ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon source=\"\\\n    \\n\/tool fetch url=\\\\\"http:\/\/joshaven.com\/spamhaus.rsc\\\\\" mode=http;\\\n    \\n:log info \\\\\"Downloaded spamhaus.rsc from Joshaven.com\\\\\";\\\n    \\n\"\nadd comment=\"$compfix Apply spamnaus List\" dont-require-permissions=no name=\\\n    ReplaceSpamhaus owner=ccp421 policy=\\\n    ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon source=\"\\\n    \\n\/ip firewall address-list remove [find where comment=\\\\\"SpamHaus\\\\\"]\\\n    \\n\/import file-name=spamhaus.rsc;\\\\r\\\n    \\n\/file remove spamhaus.rsc\\\n    \\n:log info \\\\\"Removed old Spamhaus records and imported new list\\\\\";\\\n    \\n\"\nadd comment=\"$compfix Download dshield list\" dont-require-permissions=no name=\\\n    Download_dshield owner=ccp421 policy=\\\n    ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon source=\"\\\n    \\n\/tool fetch url=\\\\\"http:\/\/joshaven.com\/dshield.rsc\\\\\" mode=http;\\\n    \\n:log info \\\\\"Downloaded dshield.rsc from Joshaven.com\\\\\";\\\n    \\n\"\nadd comment=\"$compfix Apply dshield List\" dont-require-permissions=no name=\\\n    Replace_dshield owner=ccp421 policy=\\\n    ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon source=\"\\\n    \\n\/ip firewall address-list remove [find where comment=\\\\\"DShield\\\\\"]\\\n    \\n\/import file-name=dshield.rsc;\\\\r\\\n    \\n\/file remove dshield.rsc\\\n    \\n:log info \\\\\"Removed old dshield records and imported new list\\\\\";\\\n    \\n\"\nadd comment=\"$compfix Download malc0de list\" dont-require-permissions=no name=\\\n    Download_malc0de owner=ccp421 policy=\\\n    ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon source=\"\\\n    \\n\/tool fetch url=\\\\\"http:\/\/joshaven.com\/malc0de.rsc\\\\\" mode=http;\\\n    \\n:log info \\\\\"Downloaded malc0de.rsc from Joshaven.com\\\\\";\\\n    \\n\"\nadd comment=\"$compfix Apply malc0de List\" dont-require-permissions=no name=\\\n    Replace_malc0de owner=ccp421 policy=\\\n    ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon source=\"\\\n    \\n\/ip firewall address-list remove [find where comment=\\\\\"malc0de\\\\\"]\\\n    \\n\/import file-name=malc0de.rsc;\\\\r\\\n    \\n\/file remove malc0de.rsc\\\n    \\n:log info \\\\\"Removed old malc0de records and imported new list\\\\\";\\\n    \\n\"\n# Fail2Ban Device Services\n\/system scheduler\nadd comment=\"$compfix fail2ban Router ServicesSchedule\" interval=5m name=\\\n    fail2banSchedule on-event=fail2ban policy=\\\n    ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon \\\n    start-date=jan\/01\/1970 start-time=00:00:00\n\/system script\nadd comment=\"$compfix Fail2Ban Router Services\" dont-require-permissions=yes name=\\\n    fail2ban owner=ccp421 policy=\\\n    ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon source=\"#\\\n    Begin Script.\\\\r\\\\\\n\\\n    \\\\r\\\\\\n#define How many times login failed from same address will be ban.\\\\r\\\\\\n:local maxtried 10\\\\r\\\\\\n\\\\r\\\\\\n#define The baned addresses timeout.[1d: one day,30m: 30 minutes]\\\\r\\\\\\n:local bantime 3d\\\\r\\\\\\n\\\\r\\\\\\n#define The exception address will not be ban.\\\\r\\\\\\n:local exip 1.2.3.4\\\\r\\\\\\n\\\\r\\\\\\n\/log\\\\r\\\\\\n:foreach i in=[find message~\\\\\"login failure\\\\\" ] do={\\\\r\\\\\\n:local msg [get \\\\$i message]\\\\r\\\\\\n:local theip [:pick \\\\$msg ([:find \\\\$msg \\\\\"from \\\\\"]+5) [:find \\\\$msg \\\\\" vi\\\\\\na\\\\\"])]\\\\r\\\\\\n:if (\\\\$theip != \\\\$exip) do={\\\\r\\\\\\n:local timesban [:len [\/ip fi addr find list=blacklist address=\\\\$theip]]\\\\r\\\\\\n:if (\\\\$timesban = 0) do={\\\\r\\\\\\n:local times [:len [\/ip fi addr find list=loginfailure address=\\\\$theip]]\\\\r\\\\\\n:if (\\\\$times = 0) do={\/ip fi addr add list=loginfailure address=\\\\$theip \\\\\\ntimeout=1m comment=1} else={:local thecm [:tonum ([\/ip fi addr get [find l\\\\\\nist=loginfailure address=\\\\$theip] comment] + 1)];:if (\\\\$thecm > \\\\$maxtried\\\\\\n_) do={[\/ip fi addr add list=blacklist timeout=\\\\$bantime address=\\\\$theip \\\\\\ncomment=\\\\\"Fail2Ban\\\\\"];[:log info \\\\\"Fail2Ban: IP Address \\\\$theip added to B\\\\\\nlack List\\\\\"]]} else={\/ip fi addr set [find list=loginfailure address=\\\\$thei\\\\\\np] comment=\\\\$thecm}}}\\\\r\\\\\\n}\\\\r\\\\\\n}\\\\r\\\\\\n#End Script.\\\\r\\\\\\n\"\n# Auto Update\n\/system scheduler\nadd comment=\"$compfix System Auto Update\" interval=1d name=Auto-Check-Updates \\\n    on-event=auto-update policy=\\\n    ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon \\\n    start-date=mar\/28\/2020 start-time=03:00:00\nadd comment=\"$compfix This is only auto enabled do not enable\" disabled=yes interval=\\\n    1d name=firmware-update on-event=firmware-update-reboot policy=\\\n    ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon \\\n    start-date=mar\/29\/2020 start-time=03:05:00\n\/system script\nadd comment=\"$compfix System Auto Update\" dont-require-permissions=yes name=\\\n    auto-update owner=ccp421 policy=\\\n    ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon source=\"\/\\\n    system package update\\\\r\\\\\\ncheck-for-updates once\\\\r\\\\\\n:delay 10s;\\\\r\\\\\\n:if ( [get status] = \\\\\"New version is available\\\\\") do={  \/system schedul\\\\\\ner enable firmware-update-reboot  };{ install }\"\nadd comment=\"$compfix Firmware Update Reboot\" dont-require-permissions=yes name=\\\n    firmware-update-reboot owner=ccp421 policy=\\\n    ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon source=\"\/\\\n    system scheduler disable firmware-update\\\\r\\\\\\n:delay 10s;\\\\r\\\\\\n\/system reboot\"\n#\n#\n#\n#\n# +++Section6 LockDown+++\n#\n# Blink Six Times Notice for Section Six\n\/system leds set numbers=[ \/system leds find leds~\"sfp-sfpplus-led\" ] type=on\n:delay 1.0\n\/system leds set numbers=[ \/system leds find leds~\"sfp-sfpplus-led\" ] type=off\n:delay 1.0\n\/system leds set numbers=[ \/system leds find leds~\"sfp-sfpplus-led\" ] type=on\n:delay 1.0\n\/system leds set numbers=[ \/system leds find leds~\"sfp-sfpplus-led\" ] type=off\n:delay 1.0\n\/system leds set numbers=[ \/system leds find leds~\"sfp-sfpplus-led\" ] type=on\n:delay 1.0\n\/system leds set numbers=[ \/system leds find leds~\"sfp-sfpplus-led\" ] type=off\n:delay 1.0\n\/system leds set numbers=[ \/system leds find leds~\"sfp-sfpplus-led\" ] type=on\n:delay 1.0\n\/system leds set numbers=[ \/system leds find leds~\"sfp-sfpplus-led\" ] type=off\n:delay 1.0\n\/system leds set numbers=[ \/system leds find leds~\"sfp-sfpplus-led\" ] type=on\n:delay 1.0\n\/system leds set numbers=[ \/system leds find leds~\"sfp-sfpplus-led\" ] type=off\n:delay 1.0\n\/system leds set numbers=[ \/system leds find leds~\"sfp-sfpplus-led\" ] type=on\n:delay 1.0\n\/system leds set numbers=[ \/system leds find leds~\"sfp-sfpplus-led\" ] type=off\n:delay 5.0\n#\n\/system identity\nset name=$devid\n#\n\/ip cloud\nset ddns-enabled=yes\n#\n\/system clock\nset time-zone-name=$dtzone\n#\n\/system logging action\nset 0 memory-lines=10000\n#\n\/ip neighbor discovery-settings\nset discover-interface-list=$n1sname\n#\n\/ip service\nset telnet disabled=yes\nset ftp disabled=yes\nset www disabled=yes\nset ssh disabled=yes\nset api disabled=yes\nset winbox port=$winport\nset api-ssl disabled=yes\n#\n\/tool bandwidth-server\nset authenticate=yes enabled=no\n#\n\/tool mac-server\nset allowed-interface-list=$n1sname\n\/tool mac-server mac-winbox\nset allowed-interface-list=$n1sname\n\/tool mac-server ping\nset enabled=no\n#\n\/ip smb\nset allow-guests=no\n\/ip smb shares\nset [ find default=yes ] disabled=yes\n#\n\/system routerboard settings\nset auto-upgrade=yes boot-delay=1s boot-device=nand-only \\\n    protected-routerboot=enabled reformat-hold-button=19s \\\n    reformat-hold-button-max=9m59s silent-boot=yes\n#\n\/tool romon\nset enabled=yes id=\"$romonid\"\n\/tool romon port\nset [ find default=yes ] forbid=yes\nadd disabled=no interface=\"vlan$n1vlan\"\n#\n\/system note\nset note=\"\\\\\\\n    \\\\\\n     \\\\\\`++++o- .s -+++y: h+   \/h\\\\\\` \/o++o\/  y\\\\\\`\\\\\\`+++ss oo+++\/ oo\/+o:\\\\\\\\r\\\\\\\\\n    \\\\\\n     h\/   \\\\\\`\\\\\\` -d   .y:  ms: .yd\\\\\\`+y    s+ N\\\\\\`   oo  y+---\\\\\\` y\/   y+\\\\\\\\r\\\\\\\\\n    \\\\\\n     h:  ++m -d  +s\\\\\\`   m h.h\\\\\\`d\\\\\\`+s    oo N\\\\\\` -y-   yo---. y\/   s+\\\\\\\\r\\\\\\\\\n    \\\\\\n     \\\\\\`o++++o -y yy+++\/ h .d- h\\\\\\` +o++o+  d\\\\\\`\/d++++\\\\\\`ss++++ ss\/+o+\\\\\\\\r\\\\\\\\\n    \\\\n -:---.                                                       ..--::\\\\\\\\r\\\\\\\\\n    \\\\nsMMMMMMMNmdyo\/.         gizmo@gizmo421.info           .:oydmNMMMMMMMo\\\\\\\\r\\\\\\\\\n    \\\\n:NMMMMMMMMMMMMms:                                 \/ymMMMMMMMMMMMMN-\\\\\\\\r\\\\\\\\\\\\\\\\r\\\\\\\\\n    \\\\noMMMMMMMMMMMMMMMmo-:\/++oo+\/:.       .:\/+ooo+\/-.oNMMMMMMMMMMMMMMM+\\\\\\\\r\\\\\\\\\n    \\\\n.MMMMMMMMMMMMMMMMMMMMMMMMMMMMNh+:ohNMMMMMMMMMMMMMMMMMMMMMMMMMMMM.\\\\\\\\r\\\\\\\\\n    \\\\n NMMMMMMMMMMMMMMMMMNdhyhhhmMMMMMMMMMMMmdhhhhmMMMMMMMMMMMMMMMMMMm\\\\\\\\r\\\\\\\\\n    \\\\n mMMMMMMMMMMMMMMMMy         -+hNMNh+-         yMMMMMMMMMMMMMMMMd\\\\\\\\r\\\\\\\\\n    \\\\n sMMMMMMMMMMMMMMN\/              .              \/NMMMMMMMMMMMMMMs\\\\\\\\r\\\\\\\\\n    \\\\n  dMMMMMMMMMMMMh.                                hMMMMMMMMMMMMh     \\\\\\\\r\\\\\\\\\n    \\\\n    sMMMMMMMMMN\/     .-:\/:-.           .::\/:-      oNMMMMMMMMMo\\\\\\\\r\\\\\\\\\n    \\\\n     -yMMMMMMMo  -ohNMMMMMmMms.     .sNMmMMMMMNho-  sMMMMMMMy-\\\\\\\\r\\\\\\\\\\\\\\\\r\\\\\\\\\n    \\\\n        .+hMMMM \/mNysMMMMMMo sMy     hMo sMMMMMMoyNm\/oMMMNh+\\\\\\\\r\\\\\\\\\n    \\\\n           mMMM +Md  mMMMMN:-NN-     -Nm-\/NMMMMd  mM\/oMMMd\\\\\\\\r\\\\\\\\\n    \\\\n           mMMM  +Nmo-\/ooo+yMd-       -dMy+os+\/-oNN\/ oMMMm\\\\\\\\r\\\\\\\\\n    \\\\n           mMMM    \/ymNMNmho-   :+++-   -ohmNMNmy+   oMMMd\\\\\\\\r\\\\\\\\\n    \\\\n          mMMM+            \/osNMMMMMd+:.            oMMMd\\\\\\\\r\\\\\\\\\n    \\\\n         dMMM+         .yMMMMMMMMMMMMMMm+          oMMMd\\\\\\\\r\\\\\\\\\n    \\\\n         dMMMo         dMMMdhdMMMMMmhdMMMh         oMMMh\\\\\\\\r\\\\\\\\\n    \\\\n         hMMMs         -hMMdho::\/\/\/shhMMh.         yMMMy\\\\\\\\r\\\\\\\\\n    \\\\n         +MMMMy:         -sdMMMMMMMMMdo.         \/hMMMM\/\\\\\\\\r\\\\\\\\\n    \\\\n          +NMMMMNho:.        -\/++\/\/-        .\/sdMMMMMm\/\\\\\\\\r\\\\\\\\\n    \\\\n              :yNMMMMMMNdys+\/-.       .-\/+shdMMMMMMMms:\\\\\\\\r\\\\\\\\\n    \\\\n               -+sdNMMMMMMMMMMMNNNMMMMMMMMMMMNhs\/.\\\\\\\\r\\\\\\\\\n    \\\\n                    .:+oydmMMMMMMMMMMMmdyo\/:.\\\\\\\\r\\\\\\\\\n    \\\\n                               .--::-.\\\\\\\\r\\\\\\\\\n    \\\\n                     Why do we do what we do?\\\\\\\\r\\\\\\\\\n    \\\\n                        Because I CAN!!!\\\\\\\\r\\\\\\\\\n    \\\\n\"\n#\n\/user add name=$nadmin comment=\"$compfix $nadmincom\" password=$nadminpass group=full\n\/user remove admin\n#\n#\n#\n#\n# All Done Notice\n\/system leds set numbers=[ \/system leds find leds~\"sfp-sfpplus-led\" ] type=on\n:delay 0.2\n\/system leds set numbers=[ \/system leds find leds~\"sfp-sfpplus-led\" ] type=off\n:delay 0.2\n\/system leds set numbers=[ \/system leds find leds~\"sfp-sfpplus-led\" ] type=on\n:delay 0.2\n\/system leds set numbers=[ \/system leds find leds~\"sfp-sfpplus-led\" ] type=off\n:delay 0.2\n\/system leds set numbers=[ \/system leds find leds~\"sfp-sfpplus-led\" ] type=on\n:delay 0.2\n\/system leds set numbers=[ \/system leds find leds~\"sfp-sfpplus-led\" ] type=off\n:delay 0.2\n\/system leds set numbers=[ \/system leds find leds~\"sfp-sfpplus-led\" ] type=on\n:delay 0.2\n\/system leds set numbers=[ \/system leds find leds~\"sfp-sfpplus-led\" ] type=off\n:delay 0.2\n\/system leds set numbers=[ \/system leds find leds~\"sfp-sfpplus-led\" ] type=on\n:delay 0.2\n\/system leds set numbers=[ \/system leds find leds~\"sfp-sfpplus-led\" ] type=off\n:delay 0.2\n\/system leds set numbers=[ \/system leds find leds~\"sfp-sfpplus-led\" ] type=on\n:delay 0.2\n\/system leds set numbers=[ \/system leds find leds~\"sfp-sfpplus-led\" ] type=off\n:delay 0.2\n\/system leds set numbers=[ \/system leds find leds~\"sfp-sfpplus-led\" ] type=on\n:delay 0.2\n\/system leds set numbers=[ \/system leds find leds~\"sfp-sfpplus-led\" ] type=off\n:delay 0.2\n\/system leds set numbers=[ \/system leds find leds~\"sfp-sfpplus-led\" ] type=on\n:delay 0.2\n\/system leds set numbers=[ \/system leds find leds~\"sfp-sfpplus-led\" ] type=off\n:delay 0.2\n\/system leds set numbers=[ \/system leds find leds~\"sfp-sfpplus-led\" ] type=on\n:delay 0.2\n\/system leds set numbers=[ \/system leds find leds~\"sfp-sfpplus-led\" ] type=off\n:delay 0.2\n\/system leds set numbers=[ \/system leds find leds~\"sfp-sfpplus-led\" ] type=on\n:delay 0.2\n\/system leds set numbers=[ \/system leds find leds~\"sfp-sfpplus-led\" ] type=off\n:delay 0.2\n\/system leds set numbers=[ \/system leds find leds~\"sfp-sfpplus-led\" ] type=on\n:delay 0.2\n\/system leds set numbers=[ \/system leds find leds~\"sfp-sfpplus-led\" ] type=off\n:delay 0.2\n\/system leds set numbers=[ \/system leds find leds~\"sfp-sfpplus-led\" ] type=on\n:delay 0.2\n\/system leds set numbers=[ \/system leds find leds~\"sfp-sfpplus-led\" ] type=off\n:delay 0.2\n\/system leds set numbers=[ \/system leds find leds~\"sfp-sfpplus-led\" ] type=on\n:delay 0.2\n\/system leds set numbers=[ \/system leds find leds~\"sfp-sfpplus-led\" ] type=off\n:delay 0.2\n\/system leds set numbers=[ \/system leds find leds~\"sfp-sfpplus-led\" ] type=on\n:delay 0.2\n\/system leds set numbers=[ \/system leds find leds~\"sfp-sfpplus-led\" ] type=off\n:delay 0.2\n\/system leds set numbers=[ \/system leds find leds~\"sfp-sfpplus-led\" ] type=on\n:delay 0.2\n\/system leds set numbers=[ \/system leds find leds~\"sfp-sfpplus-led\" ] type=off\n:delay 0.2\n\/system leds set numbers=[ \/system leds find leds~\"sfp-sfpplus-led\" ] type=on\n:delay 0.2\n\/system leds set numbers=[ \/system leds find leds~\"sfp-sfpplus-led\" ] type=off\n:delay 0.2\n\/system leds set numbers=[ \/system leds find leds~\"sfp-sfpplus-led\" ] type=on\n:delay 0.2\n\/system leds set numbers=[ \/system leds find leds~\"sfp-sfpplus-led\" ] type=off\n:delay 1.0\n\/system leds set type=$state0 numbers=0\n\/system reboot\n`;\n\n        let variables = {}; \/\/ Stores { variableName: value }\n\n        \/\/ Define the structure of sections and their associated variables\n        \/\/ This helps in grouping variables for display\n        const sections = {\n            \"Section 0: Global Variables\": [\n                \"nadmin\", \"nadminpass\", \"nadmincom\", \"devid\", \"romonid\", \"ddns\",\n                \"dtzone\", \"winport\", \"lanlist\", \"wanlist\", \"wvlan\", \"compfix\"\n            ],\n            \"Section 1: Network 1 (Management)\": [\n                \"n1name\", \"n1sname\", \"n1vlan\", \"n1ip\", \"n1network\", \"n1mask\",\n                \"n1gate\", \"n1pool\", \"n1dns\"\n            ],\n            \"Section 2: Network 2 (VoIP)\": [\n                \"n2name\", \"n2sname\", \"n2vlan\", \"n2ip\", \"n2network\", \"n2mask\",\n                \"n2gate\", \"n2pool\", \"n2dns\"\n            ],\n            \"Section 3: Network 3 (Office)\": [\n                \"n3name\", \"n3sname\", \"n3ssidname\", \"n3ssidpwd\", \"n3vlan\", \"n3ip\",\n                \"n3network\", \"n3mask\", \"n3gate\", \"n3pool\", \"n3dns\"\n            ],\n            \"Section 4: Network 4 (CCTV)\": [\n                \"n4name\", \"n4sname\", \"n4vlan\", \"n4ip\", \"n4network\", \"n4mask\",\n                \"n4gate\", \"n4pool\", \"n4dns\"\n            ],\n            \"Section 5: Network 5 (Guest)\": [\n                \"n5name\", \"n5sname\", \"n5ssidname\", \"n5user\", \"n5upswd\", \"n5ulimt\",\n                \"n5umax\", \"n5vlan\", \"n5ip\", \"n5network\", \"n5mask\", \"n5gate\",\n                \"n5pool\", \"n5dns\"\n            ],\n            \"Section 6: Network 6 (VPN)\": [\n                \"n6name\", \"n6sname\", \"n6ip\", \"n6network\", \"n6mask\", \"n6gate\",\n                \"n6pool\", \"n6dns\", \"vpnun\", \"vpnpass\"\n            ]\n        };\n\n        \/**\n         * Helper function to get specific placeholder\/title text for input fields.\n         * @param {string} varName - The name of the variable.\n         * @param {string} currentValue - The current value of the variable.\n         * @returns {object} An object containing label, placeholder, and title.\n         *\/\n        function getInputDetails(varName, currentValue) {\n            switch (varName) {\n                case 'nadmin': return { label: 'New Admin User Name:', placeholder: currentValue || 'e.g., yourusername', title: 'Enter the new administrator username (no spaces allowed).' };\n                case 'nadminpass': return { label: 'New Admin User Password:', placeholder: currentValue || 'e.g., SecureP@ssw0rd123', title: 'Enter a strong password for the new administrator.' };\n                case 'nadmincom': return { label: 'New Admin User Comment:', placeholder: currentValue || 'e.g., Primary IT Account', title: 'Add a comment for the new administrator account.' };\n                case 'devid': return { label: 'Device ID:', placeholder: currentValue || 'e.g., [ \/system routerboard get serial-number ]', title: 'The device identifier. Usually retrieved automatically from the router.' };\n                case 'romonid': return { label: 'RoMon ID:', placeholder: currentValue || 'e.g., [\/interface ethernet get [find where name=\"ether1\"] orig-mac-address]', title: 'The RoMon ID, typically the MAC address of ether1.' };\n                case 'ddns': return { label: 'Device DNS:', placeholder: currentValue || 'e.g., 8.8.8.8,8.8.4.4', title: 'Enter preferred DNS servers, comma-separated.' };\n                case 'dtzone': return { label: 'Device Time Zone:', placeholder: currentValue || 'e.g., America\/Chicago', title: 'Specify the device\\'s timezone (e.g., \"America\/New_York\").' };\n                case 'winport': return { label: 'Device Winbox Port:', placeholder: currentValue || 'e.g., 8301', title: 'Set a custom Winbox port for secure access.' };\n                case 'lanlist': return { label: 'LAN Interface List (No Spaces):', placeholder: currentValue || 'e.g., LAN', title: 'Name of the interface list for LAN ports (no spaces).' };\n                case 'wanlist': return { label: 'WAN Interface List (No Spaces):', placeholder: currentValue || 'e.g., WAN', title: 'Name of the interface list for WAN ports (no spaces).' };\n                case 'wvlan': return { label: 'WAN VLAN:', placeholder: currentValue || 'e.g., 926', title: 'VLAN ID for the WAN network (numeric).' };\n\n                case 'n1name': return { label: 'Network 1 Name (used for Comments):', placeholder: currentValue || 'e.g., Management Network', title: 'Descriptive name for this network.' };\n                case 'n1sname': return { label: 'Network 1 Short Name (No Spaces):', placeholder: currentValue || 'e.g., MAN-NET', title: 'Short, no-space name for this network.' };\n                case 'n1vlan': return { label: 'Network 1 LAN VLAN:', placeholder: currentValue || 'e.g., 626', title: 'VLAN ID for this LAN network (numeric).' };\n                case 'n1ip': return { label: 'Network 1 LAN IP:', placeholder: currentValue || 'e.g., 10.10.0.1', title: 'IP address for this network\\'s gateway.' };\n                case 'n1network': return { label: 'Network 1 LAN Network:', placeholder: currentValue || 'e.g., 10.10.0.0', title: 'Network address for this LAN (e.g., 10.10.0.0).' };\n                case 'n1mask': return { label: 'Network 1 Network Mask:', placeholder: currentValue || 'e.g., 23', title: 'CIDR network mask (e.g., 24, 23).' };\n                case 'n1gate': return { label: 'Network 1 LAN Gateway:', placeholder: currentValue || 'e.g., 10.10.0.1', title: 'Gateway IP address for this network.' };\n                case 'n1pool': return { label: 'Network 1 DHCP Pool:', placeholder: currentValue || 'e.g., 10.10.1.1-10.10.1.254', title: 'DHCP IP address range (e.g., start-end).' };\n                case 'n1dns': return { label: 'Network 1 LAN DNS:', placeholder: currentValue || 'e.g., 8.8.8.8,8.8.4.4', title: 'DNS servers for this network, comma-separated.' };\n\n                case 'n2name': return { label: 'Network 2 Name (used for Comments):', placeholder: currentValue || 'e.g., VoIP Network', title: 'Descriptive name for this network.' };\n                case 'n2sname': return { label: 'Network 2 Short Name (No Spaces):', placeholder: currentValue || 'e.g., VoIP-NET', title: 'Short, no-space name for this network.' };\n                case 'n2vlan': return { label: 'Network 2 LAN VLAN:', placeholder: currentValue || 'e.g., 835', title: 'VLAN ID for this LAN network (numeric).' };\n                case 'n2ip': return { label: 'Network 2 LAN IP:', placeholder: currentValue || 'e.g., 10.10.2.1', title: 'IP address for this network\\'s gateway.' };\n                case 'n2network': return { label: 'Network 2 LAN Network:', placeholder: currentValue || 'e.g., 10.10.2.0', title: 'Network address for this LAN (e.g., 10.10.2.0).' };\n                case 'n2mask': return { label: 'Network 2 Network Mask:', placeholder: currentValue || 'e.g., 23', title: 'CIDR network mask (e.g., 24, 23).' };\n                case 'n2gate': return { label: 'Network 2 LAN Gateway:', placeholder: currentValue || 'e.g., 10.10.2.1', title: 'Gateway IP address for this network.' };\n                case 'n2pool': return { label: 'Network 2 DHCP Pool:', placeholder: currentValue || 'e.g., 10.10.3.1-10.10.3.254', title: 'DHCP IP address range (e.g., start-end).' };\n                case 'n2dns': return { label: 'Network 2 LAN DNS:', placeholder: currentValue || 'e.g., 8.8.8.8,8.8.4.4', title: 'DNS servers for this network, comma-separated.' };\n\n                case 'n3name': return { label: 'Network 3 Name (used for Comments):', placeholder: currentValue || 'e.g., Office Network', title: 'Descriptive name for this network.' };\n                case 'n3sname': return { label: 'Network 3 Short Name (No Spaces):', placeholder: currentValue || 'e.g., Office-NET', title: 'Short, no-space name for this network.' };\n                case 'n3ssidname': return { label: 'Network 3 Wifi Name (SSID):', placeholder: currentValue || 'e.g., OfficeWiFi', title: 'SSID for this WiFi network.' };\n                case 'n3ssidpwd': return { label: 'Network 3 Wifi Password:', placeholder: currentValue || 'e.g., MySecureWiFiPassword', title: 'Password for the Office WiFi network.' };\n                case 'n3vlan': return { label: 'Network 3 LAN VLAN:', placeholder: currentValue || 'e.g., 633', title: 'VLAN ID for this LAN network (numeric).' };\n                case 'n3ip': return { label: 'Network 3 LAN IP:', placeholder: currentValue || 'e.g., 10.10.4.1', title: 'IP address for this network\\'s gateway.' };\n                case 'n3network': return { label: 'Network 3 LAN Network:', placeholder: currentValue || 'e.g., 10.10.4.0', title: 'Network address for this LAN (e.g., 10.10.4.0).' };\n                case 'n3mask': return { label: 'Network 3 Network Mask:', placeholder: currentValue || 'e.g., 23', title: 'CIDR network mask (e.g., 24, 23).' };\n                case 'n3gate': return { label: 'Network 3 LAN Gateway:', placeholder: currentValue || 'e.g., 10.10.4.1', title: 'Gateway IP address for this network.' };\n                case 'n3pool': return { label: 'Network 3 DHCP Pool:', placeholder: currentValue || 'e.g., 10.10.5.1-10.10.5.254', title: 'DHCP IP address range (e.g., start-end).' };\n                case 'n3dns': return { label: 'Network 3 LAN DNS:', placeholder: currentValue || 'e.g., 8.8.8.8,8.8.4.4', title: 'DNS servers for this network, comma-separated.' };\n\n                case 'n4name': return { label: 'Network 4 Name (used for Comments):', placeholder: currentValue || 'e.g., CCTV Network', title: 'Descriptive name for this network.' };\n                case 'n4sname': return { label: 'Network 4 Short Name (No Spaces):', placeholder: currentValue || 'e.g., CCTV-NET', title: 'Short, no-space name for this network.' };\n                case 'n4vlan': return { label: 'Network 4 LAN VLAN:', placeholder: currentValue || 'e.g., 228', title: 'VLAN ID for this LAN network (numeric).' };\n                case 'n4ip': return { label: 'Network 4 LAN IP:', placeholder: currentValue || 'e.g., 10.10.6.1', title: 'IP address for this network\\'s gateway.' };\n                case 'n4network': return { label: 'Network 4 LAN Network:', placeholder: currentValue || 'e.g., 10.10.6.0', title: 'Network address for this LAN (e.g., 10.10.6.0).' };\n                case 'n4mask': return { label: 'Network 4 Network Mask:', placeholder: currentValue || 'e.g., 23', title: 'CIDR network mask (e.g., 24, 23).' };\n                case 'n4gate': return { label: 'Network 4 LAN Gateway:', placeholder: currentValue || 'e.g., 10.10.6.1', title: 'Gateway IP address for this network.' };\n                case 'n4pool': return { label: 'Network 4 DHCP Pool:', placeholder: currentValue || 'e.g., 10.10.7.1-10.10.7.254', title: 'DHCP IP address range (e.g., start-end).' };\n                case 'n4dns': return { label: 'Network 4 LAN DNS:', placeholder: currentValue || 'e.g., 8.8.8.8,8.8.4.4', title: 'DNS servers for this network, comma-separated.' };\n\n                case 'n5name': return { label: 'Network 5 Name (used for Comments):', placeholder: currentValue || 'e.g., Guest Network', title: 'Descriptive name for this network.' };\n                case 'n5sname': return { label: 'Network 5 Short Name (No Spaces):', placeholder: currentValue || 'e.g., Guest-NET', title: 'Short, no-space name for this network.' };\n                case 'n5ssidname': return { label: 'Network 5 Wifi Name (SSID):', placeholder: currentValue || 'e.g., GuestWiFi', title: 'SSID for this WiFi network.' };\n                case 'n5user': return { label: 'Network 5 Guest Username:', placeholder: currentValue || 'e.g., guestuser', title: 'Username for the Guest Hotspot.' };\n                case 'n5upswd': return { label: 'Network 5 Guest Password:', placeholder: currentValue || 'e.g., guestpass', title: 'Password for the Guest Hotspot.' };\n                case 'n5ulimt': return { label: 'Network 5 Guest Speed Limit (Rx\/Tx):', placeholder: currentValue || 'e.g., 1m\/5m', title: 'Bandwidth limit for guest users (Rx\/Tx, e.g., 1m\/5m).' };\n                case 'n5umax': return { label: 'Network 5 Guest MAX Users:', placeholder: currentValue || 'e.g., 200', title: 'Maximum number of concurrent guest users (numeric).' };\n                case 'n5vlan': return { label: 'Network 5 LAN VLAN:', placeholder: currentValue || 'e.g., 483', title: 'VLAN ID for this LAN network (numeric).' };\n                case 'n5ip': return { label: 'Network 5 LAN IP:', placeholder: currentValue || 'e.g., 172.16.0.1', title: 'IP address for this network\\'s gateway.' };\n                case 'n5network': return { label: 'Network 5 LAN Network:', placeholder: currentValue || 'e.g., 172.16.0.0', title: 'Network address for this LAN (e.g., 172.16.0.0).' };\n                case 'n5mask': return { label: 'Network 5 Network Mask:', placeholder: currentValue || 'e.g., 23', title: 'CIDR network mask (e.g., 24, 23).' };\n                case 'n5gate': return { label: 'Network 5 LAN Gateway:', placeholder: currentValue || 'e.g., 172.16.0.1', title: 'Gateway IP address for this network.' };\n                case 'n5pool': return { label: 'Network 5 DHCP Pool:', placeholder: currentValue || 'e.g., 172.16.0.2-172.16.1.254', title: 'DHCP IP address range (e.g., start-end).' };\n                case 'n5dns': return { label: 'Network 5 LAN DNS:', placeholder: currentValue || 'e.g., 195.46.39.39,195.46.39.40', title: 'DNS servers for this network, comma-separated.' };\n\n                case 'n6name': return { label: 'Network 6 Name (used for Comments):', placeholder: currentValue || 'e.g., VPN Network', title: 'Descriptive name for this network.' };\n                case 'n6sname': return { label: 'Network 6 Short Name (No Spaces):', placeholder: currentValue || 'e.g., VPN-NET', title: 'Short, no-space name for this network.' };\n                case 'n6ip': return { label: 'Network 6 VPN IP:', placeholder: currentValue || 'e.g., 192.168.88.1', title: 'IP address for this network\\'s gateway.' };\n                case 'n6network': return { label: 'Network 6 VPN Network:', placeholder: currentValue || 'e.g., 192.168.88.0', title: 'Network address for this LAN (e.g., 192.168.88.0).' };\n                case 'n6mask': return { label: 'Network 6 Network Mask:', placeholder: currentValue || 'e.g., 24', title: 'CIDR network mask (e.g., 24, 23).' };\n                case 'n6gate': return { label: 'Network 6 VPN Gateway:', placeholder: currentValue || 'e.g., 192.168.88.1', title: 'Gateway IP address for this network.' };\n                case 'n6pool': return { label: 'Network 6 DHCP Pool:', placeholder: currentValue || 'e.g., 192.168.88.2-192.168.88.254', title: 'DHCP IP address range (e.g., start-end).' };\n                case 'n6dns': return { label: 'Network 6 LAN DNS:', placeholder: currentValue || 'e.g., 8.8.8.8,8.8.4.4', title: 'DNS servers for this network, comma-separated.' };\n                case 'vpnun': return { label: 'VPN Username:', placeholder: currentValue || 'e.g., VPNUser', title: 'Username for VPN access.' };\n                case 'vpnpass': return { label: 'VPN Password:', placeholder: currentValue || 'e.g., VPN_P@ssw0rd', title: 'Password for VPN access.' };\n\n                case 'compfix': return { label: 'Comment Prefix:', placeholder: currentValue || 'e.g., MYORG-cfg:', title: 'Prefix used for comments in the MikroTik script.' };\n                default: return { label: varName + ':', placeholder: currentValue || 'Enter value', title: `Value for ${varName}.` };\n            }\n        }\n\n        \/**\n         * Extracts variables from the script content using a regex pattern.\n         * Populates the 'variables' object with found variables and their initial values.\n         * Assumes variables are in the format :set $variableName \"value\";\n         * @param {string} scriptText - The content of the uploaded script.\n         *\/\n        function extractVariables(scriptText) {\n            const regex = \/:set \\$(\\w+)\\s+\"([^\"]*)\";\/g;\n            let match;\n            const foundVariables = {};\n            while ((match = regex.exec(scriptText)) !== null) {\n                const varName = match[1];\n                const varValue = match[2];\n                foundVariables[varName] = varValue;\n            }\n            variables = foundVariables; \/\/ Update the global variables object\n            renderVariables(); \/\/ Render the UI\n        }\n\n        \/**\n         * Renders the input fields dynamically based on the 'variables' object and 'sections' structure.\n         *\/\n        function renderVariables() {\n            const container = document.getElementById('variable-fields-container');\n            container.innerHTML = ''; \/\/ Clear existing fields\n\n            if (Object.keys(variables).length === 0) {\n                document.getElementById('variable-input-section').classList.add('hidden');\n                document.getElementById('no-variables-message').classList.remove('hidden');\n                return;\n            } else {\n                document.getElementById('variable-input-section').classList.remove('hidden');\n                document.getElementById('no-variables-message').classList.add('hidden');\n            }\n\n\n            for (const sectionName in sections) {\n                const sectionDiv = document.createElement('div');\n                sectionDiv.className = 'mb-6';\n\n                const sectionTitle = document.createElement('h3');\n                sectionTitle.className = 'text-xl font-semibold text-gray-800 border-b pb-2 mb-4 mt-6';\n                sectionTitle.textContent = sectionName;\n                sectionDiv.appendChild(sectionTitle);\n\n                const gridDiv = document.createElement('div');\n                gridDiv.className = 'grid grid-cols-1 md:grid-cols-2 gap-4';\n\n                sections[sectionName].forEach(varName => {\n                    if (variables.hasOwnProperty(varName)) {\n                        const { label, placeholder, title } = getInputDetails(varName, variables[varName]);\n\n                        const fieldDiv = document.createElement('div');\n                        fieldDiv.className = 'flex flex-col';\n\n                        const labelElem = document.createElement('label');\n                        labelElem.htmlFor = varName;\n                        labelElem.className = 'text-sm font-medium text-gray-700 mb-1';\n                        labelElem.textContent = label;\n                        fieldDiv.appendChild(labelElem);\n\n                        const inputElem = document.createElement('input');\n                        inputElem.type = 'text';\n                        inputElem.id = varName;\n                        inputElem.value = variables[varName];\n                        inputElem.className = 'mt-1 p-2 border border-gray-300 rounded-md shadow-sm focus:ring-blue-500 focus:border-blue-500 block w-full sm:text-sm';\n                        inputElem.placeholder = placeholder;\n                        inputElem.title = title;\n                        inputElem.addEventListener('input', (e) => {\n                            variables[varName] = e.target.value; \/\/ Update global variables object directly\n                        });\n                        fieldDiv.appendChild(inputElem);\n\n                        gridDiv.appendChild(fieldDiv);\n                    }\n                });\n                if (gridDiv.children.length > 0) { \/\/ Only append section if it has variables\n                  sectionDiv.appendChild(gridDiv);\n                  container.appendChild(sectionDiv);\n                }\n            }\n        }\n\n\n        \/**\n         * Generates the script by replacing placeholders with current variable values\n         * and immediately triggers the download.\n         *\/\n        function generateAndDownloadScript() {\n            let finalScriptContent = preloadedMikrotikScript;\n\n            \/\/ First, perform a global replacement of all $variableName instances with their current values.\n            for (const varName in variables) {\n                const value = variables[varName];\n                const regex = new RegExp(`\\\\$${varName}\\\\b`, 'g'); \/\/ Use word boundary \\b\n                finalScriptContent = finalScriptContent.replace(regex, value);\n            }\n\n            \/\/ Convert the script to an array of lines to easily remove blocks\n            let lines = finalScriptContent.split('\\n');\n            let filteredLines = [];\n            let inRemovalBlock = false;\n\n            for (let i = 0; i < lines.length; i++) {\n                const line = lines[i];\n\n                if (line.includes('model = RouterBOARD 3011UiAS')) {\n                    inRemovalBlock = true;\n                    continue; \/\/ Skip thisas line\n                }\n\n                if (line.includes('# Lets Begin')) {\n                    inRemovalBlock = false;\n                    continue; \/\/ Skip this line\n                }\n\n                if (!inRemovalBlock) {\n                    \/\/ Also remove the original ':set $variable \"value\";' lines here\n                    if (!line.trim().match(\/^:set \\$\\w+\\s+\"[^\"]*\";$\/)) {\n                        filteredLines.push(lines[i]);\n                    }\n                }\n            }\n\n            finalScriptContent = filteredLines.join('\\n');\n\n            \/\/ Trigger download\n            const blob = new Blob([finalScriptContent], { type: 'text\/plain' });\n            const url = URL.createObjectURL(blob);\n            const a = document.createElement('a');\n            a.href = url;\n            a.download = `mikrotik_script_customized.rsc`;\n            document.body.appendChild(a);\n            a.click();\n            document.body.removeChild(a);\n            URL.revokeObjectURL(url);\n        }\n\n        \/\/ Initialize on DOMContentLoaded\n        document.addEventListener('DOMContentLoaded', () => {\n            extractVariables(preloadedMikrotikScript);\n            document.getElementById('generate-script-btn').addEventListener('click', generateAndDownloadScript);\n        });\n    <\/script>\n<\/body>\n<\/html>\n\n","protected":false},"excerpt":{"rendered":"<p>MikroTik Script Customizer MikroTik Script Editor \u2728 Your custom MikroTik script is ready! Modify the parameters below to instantly generate and download your personalized script. Adjust Script Parameters The application automatically identified configurable variables (e.g., `:set $variable_name &#8220;value&#8221;;`). Update their values and download your tailored script. Generate and Download Script No variables were detected in [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-11","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/www.gizmo421.info\/index.php\/wp-json\/wp\/v2\/pages\/11","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.gizmo421.info\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.gizmo421.info\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.gizmo421.info\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.gizmo421.info\/index.php\/wp-json\/wp\/v2\/comments?post=11"}],"version-history":[{"count":3,"href":"https:\/\/www.gizmo421.info\/index.php\/wp-json\/wp\/v2\/pages\/11\/revisions"}],"predecessor-version":[{"id":14,"href":"https:\/\/www.gizmo421.info\/index.php\/wp-json\/wp\/v2\/pages\/11\/revisions\/14"}],"wp:attachment":[{"href":"https:\/\/www.gizmo421.info\/index.php\/wp-json\/wp\/v2\/media?parent=11"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}