# ================================================== # Wifi-Otantik - Provision automatique # Zone : Otantik Hub # Genere le : 2026-08-25 17:36:06 # ================================================== :put "==== Wifi-Otantik Provision START ====" :put "WinBox peut se couper: le script tourne en local (scheduler)." # ---- VARIABLES ---- :local shortname "Otantik Hub" :local slug "otantik-hub" :local wgName "wg-otantik" :local wgListenPort 13231 :local wgPrivateKey "cA1d18AfZpRXtZEimezfELm5mpcGMuk4d4b/vFGKFXo=" :local wgServerPublicKey "FQa44YKNnEbXZV5XeClfoLP0CO2bL54RxPemO5wkNT0=" :local wgServerIP "83.147.38.107" :local wgServerPort 51820 :local wgNetwork "10.88.0.0/16" :local wgLocalIP "10.88.0.6/32" :local wgServerTunnelIP "10.88.0.1/32" :local statusURL "https://wifi.otantik.cm/provision/otantik-hub/status/" :local payUrl "https://portal.otantik.cm/wifi/otantik-hub/login.html" # ---- DNS ---- /ip dns set servers=1.1.1.1,8.8.8.8 /ip dns cache flush # ---- IDENTITE ---- :put "Setting identity..." :do { /tool fetch mode=https check-certificate=no url=($statusURL . "setting_identity") keep-result=no } on-error={} /system identity set name="$shortname" # ---- WIREGUARD ---- :put "Configuring WireGuard..." :do { /tool fetch mode=https check-certificate=no url=($statusURL . "configuring_wireguard") keep-result=no } on-error={} :if ([:len [/interface wireguard find name="$wgName"]] = 0) do={ /interface wireguard add name="$wgName" listen-port=$wgListenPort private-key="$wgPrivateKey" mtu=1420 disabled=no } else={ /interface wireguard set [find name="$wgName"] listen-port=$wgListenPort private-key="$wgPrivateKey" mtu=1420 disabled=no } :if ([:len [/ip address find interface="$wgName"]] = 0) do={ /ip address add address="$wgLocalIP" interface="$wgName" comment=wifi-otantik } else={ /ip address set [find interface="$wgName"] address="$wgLocalIP" } :if ([:len [/interface wireguard peers find interface="$wgName"]] = 0) do={ /interface wireguard peers add interface="$wgName" public-key="$wgServerPublicKey" endpoint-address="$wgServerIP" endpoint-port=$wgServerPort allowed-address="$wgNetwork" persistent-keepalive=25s } else={ /interface wireguard peers set [find interface="$wgName"] public-key="$wgServerPublicKey" endpoint-address="$wgServerIP" endpoint-port=$wgServerPort allowed-address="$wgNetwork" persistent-keepalive=25s } :if ([:len [/ip route find dst-address="$wgNetwork" gateway="$wgName"]] = 0) do={ /ip route add dst-address="$wgNetwork" gateway="$wgName" comment="wifi-otantik-wg" } # ---- FIREWALL ---- :put "Configuring firewall..." :do { /tool fetch mode=https check-certificate=no url=($statusURL . "configuring_firewall") keep-result=no } on-error={} :if ([:len [/ip firewall filter find comment="wifi-otantik-wg-input"]] = 0) do={ /ip firewall filter add chain=input protocol=udp dst-port=$wgListenPort action=accept comment=wifi-otantik-wg-input } :if ([:len [/ip firewall filter find comment="wifi-otantik-mgmt"]] = 0) do={ /ip firewall filter add chain=input src-address="$wgServerTunnelIP" action=accept comment=wifi-otantik-mgmt place-before=0 } else={ /ip firewall filter move [find comment=wifi-otantik-mgmt] destination=0 } :if ([:len [/ip firewall filter find comment="wifi-otantik-icmp"]] = 0) do={ /ip firewall filter add chain=input protocol=icmp in-interface="$wgName" action=accept comment=wifi-otantik-icmp place-before=1 } :if ([:len [/ip firewall mangle find comment="wifi-otantik-mss"]] = 0) do={ /ip firewall mangle add chain=forward action=change-mss new-mss=clamp-to-pmtu passthrough=yes protocol=tcp tcp-flags=syn out-interface="$wgName" comment=wifi-otantik-mss } # ---- API ---- :put "Enabling API..." /ip service set api disabled=no port=8728 # ---- HOTSPOT + WALLED GARDEN ---- :do { /tool fetch mode=https check-certificate=no url=($statusURL . "configuring_walled_garden") keep-result=no } on-error={} :put "Creating full hotspot (pool, DHCP, server)..." :local hsIface "" :if ($hsIface = "") do={ :if ([:len [/interface bridge find name="bridge"]] > 0) do={ :set hsIface "bridge" } else={ :if ([:len [/interface bridge find]] > 0) do={ :set hsIface [/interface bridge get [:pick [/interface bridge find] 0] name] } } } :if ($hsIface = "") do={ :foreach i in=[/interface ethernet find] do={ :local dn "" :do { :set dn [/interface ethernet get $i default-name] } on-error={} :if (($hsIface = "") && ($dn != "ether1")) do={ :set hsIface [/interface ethernet get $i name] } } } :if ($hsIface = "") do={ :do { :if ([:len [/interface wireless find]] > 0) do={ :local wIface [/interface wireless get [:pick [/interface wireless find] 0] name] :if ([:len [/interface wireless security-profiles find name="wo-open"]] = 0) do={ /interface wireless security-profiles add name=wo-open mode=none } /interface wireless set [find name=$wIface] mode=ap-bridge ssid="Otantik_Hub" security-profile=wo-open disabled=no :set hsIface $wIface } } on-error={} } :if ($hsIface = "") do={ :put "WARNING: no LAN or WiFi interface found - hotspot/DHCP were NOT created. Free up an ethernet port (not ether1) or a WiFi radio, then re-run provisioning." } :put ("LAN / hotspot / PPPoE interface: " . $hsIface) :if ([:len [/ip pool find name="hs-pool"]] = 0) do={ /ip pool add name="hs-pool" ranges=10.8.192.10-10.8.255.250 } else={ /ip pool set [find name="hs-pool"] ranges=10.8.192.10-10.8.255.250 } :if ($hsIface != "") do={ :if ([:len [/ip address find comment="wifi-otantik-hs"]] = 0) do={ :do { /ip address add address=10.8.192.1/18 interface=$hsIface comment=wifi-otantik-hs } on-error={} } else={ :do { /ip address set [find comment="wifi-otantik-hs"] address=10.8.192.1/18 interface=$hsIface } on-error={} } :if ([:len [/ip dhcp-server find interface=$hsIface]] = 0) do={ :do { /ip dhcp-server add name="dhcp-hs" interface=$hsIface address-pool="hs-pool" lease-time=1h disabled=no } on-error={} } else={ :do { /ip dhcp-server set [find interface=$hsIface] address-pool="hs-pool" disabled=no } on-error={} } } :if ([:len [/ip dhcp-server network find address="10.8.192.0/18"]] = 0) do={ :do { /ip dhcp-server network add address=10.8.192.0/18 gateway=10.8.192.1 dns-server=10.8.192.1 comment=wifi-otantik-hs } on-error={} } else={ :do { /ip dhcp-server network set [find address="10.8.192.0/18"] gateway=10.8.192.1 dns-server=10.8.192.1 } on-error={} } :if ([:len [/ip firewall nat find comment="wifi-otantik-hs-masq"]] = 0) do={ /ip firewall nat add chain=srcnat src-address=10.8.192.0/18 action=masquerade comment=wifi-otantik-hs-masq } :if ([:len [/ip firewall filter find comment="wifi-otantik-hs-no-fasttrack"]] = 0) do={ :do { /ip firewall filter add chain=forward src-address=10.8.192.0/18 action=accept comment=wifi-otantik-hs-no-fasttrack place-before=0 /ip firewall filter add chain=forward dst-address=10.8.192.0/18 action=accept comment=wifi-otantik-hs-no-fasttrack place-before=0 } on-error={} } else={ :do { /ip firewall filter move [find comment="wifi-otantik-hs-no-fasttrack"] destination=0 } on-error={} } :do { /ip dns set allow-remote-requests=yes servers=1.1.1.1,8.8.8.8 } on-error={} :if ([:len [/ip dns static find comment="wifi-otantik-hs"]] = 0) do={ :do { /ip dns static add name="otantik.net" address=10.8.192.1 comment=wifi-otantik-hs } on-error={} } :if ([:len [/ip hotspot profile find name="hs-otantik"]] = 0) do={ :do { /ip hotspot profile add name=hs-otantik hotspot-address=10.8.192.1 dns-name="otantik.net" html-directory=hotspot login-by=cookie,http-chap,http-pap } on-error={} } else={ :do { /ip hotspot profile set [find name="hs-otantik"] hotspot-address=10.8.192.1 dns-name="otantik.net" html-directory=hotspot } on-error={} } :do { /ip hotspot user profile set [find default=yes] address-pool="hs-pool" } on-error={} :if ($hsIface != "") do={ :if ([:len [/ip hotspot find]] = 0) do={ :do { /ip hotspot add name=hotspot-otantik interface=$hsIface address-pool="hs-pool" profile=hs-otantik disabled=no } on-error={} } else={ :do { /ip hotspot set [:pick [/ip hotspot find] 0] interface=$hsIface address-pool="hs-pool" profile=hs-otantik disabled=no } on-error={} } } :do { :if ([:len [/ip hotspot walled-garden ip find comment="wifi-otantik-winbox"]] = 0) do={ /ip hotspot walled-garden ip add action=accept protocol=tcp dst-port=8291 comment=wifi-otantik-winbox /ip hotspot walled-garden ip add action=accept protocol=tcp dst-port=8728 comment=wifi-otantik-api /ip hotspot walled-garden ip add action=accept protocol=tcp dst-port=22 comment=wifi-otantik-ssh } } on-error={} :put "Installing walled garden..." :do { :if ([:len [/ip hotspot walled-garden find dst-host="portal.otantik.cm"]] = 0) do={ /ip hotspot walled-garden add action=allow comment=wifi-otantik dst-host="portal.otantik.cm" } } on-error={} :do { :if ([:len [/ip hotspot walled-garden find dst-host="wifi.otantik.cm"]] = 0) do={ /ip hotspot walled-garden add action=allow comment=wifi-otantik dst-host="wifi.otantik.cm" } } on-error={} :do { :if ([:len [/ip hotspot walled-garden find dst-host="business.otantik.cm"]] = 0) do={ /ip hotspot walled-garden add action=allow comment=wifi-otantik dst-host="business.otantik.cm" } } on-error={} :do { :if ([:len [/ip hotspot walled-garden find dst-host="*.otantik.cm"]] = 0) do={ /ip hotspot walled-garden add action=allow comment=wifi-otantik dst-host="*.otantik.cm" } } on-error={} :do { :if ([:len [/ip hotspot walled-garden find dst-host="mesomb.hachther.com"]] = 0) do={ /ip hotspot walled-garden add action=allow comment=wifi-otantik dst-host="mesomb.hachther.com" } } on-error={} :do { :if ([:len [/ip hotspot walled-garden find dst-host="*.mesomb.hachther.com"]] = 0) do={ /ip hotspot walled-garden add action=allow comment=wifi-otantik dst-host="*.mesomb.hachther.com" } } on-error={} :do { :if ([:len [/ip hotspot walled-garden find dst-host="mesomb.com"]] = 0) do={ /ip hotspot walled-garden add action=allow comment=wifi-otantik dst-host="mesomb.com" } } on-error={} :do { :if ([:len [/ip hotspot walled-garden find dst-host="*.mesomb.com"]] = 0) do={ /ip hotspot walled-garden add action=allow comment=wifi-otantik dst-host="*.mesomb.com" } } on-error={} :do { :if ([:len [/ip hotspot walled-garden find dst-host="fapshi.com"]] = 0) do={ /ip hotspot walled-garden add action=allow comment=wifi-otantik dst-host="fapshi.com" } } on-error={} :do { :if ([:len [/ip hotspot walled-garden find dst-host="*.fapshi.com"]] = 0) do={ /ip hotspot walled-garden add action=allow comment=wifi-otantik dst-host="*.fapshi.com" } } on-error={} :do { :if ([:len [/ip hotspot walled-garden find dst-host="live.fapshi.com"]] = 0) do={ /ip hotspot walled-garden add action=allow comment=wifi-otantik dst-host="live.fapshi.com" } } on-error={} :do { :if ([:len [/ip hotspot walled-garden find dst-host="sandbox.fapshi.com"]] = 0) do={ /ip hotspot walled-garden add action=allow comment=wifi-otantik dst-host="sandbox.fapshi.com" } } on-error={} :do { :if ([:len [/ip hotspot walled-garden find dst-host="wa.me"]] = 0) do={ /ip hotspot walled-garden add action=allow comment=wifi-otantik dst-host="wa.me" } } on-error={} :do { :if ([:len [/ip hotspot walled-garden find dst-host="api.whatsapp.com"]] = 0) do={ /ip hotspot walled-garden add action=allow comment=wifi-otantik dst-host="api.whatsapp.com" } } on-error={} :do { :if ([:len [/ip hotspot walled-garden find dst-host="*.whatsapp.com"]] = 0) do={ /ip hotspot walled-garden add action=allow comment=wifi-otantik dst-host="*.whatsapp.com" } } on-error={} :do { :if ([:len [/ip hotspot walled-garden find dst-host="fonts.googleapis.com"]] = 0) do={ /ip hotspot walled-garden add action=allow comment=wifi-otantik dst-host="fonts.googleapis.com" } } on-error={} :do { :if ([:len [/ip hotspot walled-garden find dst-host="fonts.gstatic.com"]] = 0) do={ /ip hotspot walled-garden add action=allow comment=wifi-otantik dst-host="fonts.gstatic.com" } } on-error={} :do { :if ([:len [/ip hotspot walled-garden find dst-host="www.gstatic.com"]] = 0) do={ /ip hotspot walled-garden add action=allow comment=wifi-otantik dst-host="www.gstatic.com" } } on-error={} :do { :if ([:len [/ip hotspot walled-garden find dst-host="*.gstatic.com"]] = 0) do={ /ip hotspot walled-garden add action=allow comment=wifi-otantik dst-host="*.gstatic.com" } } on-error={} :do { :if ([:len [/ip hotspot walled-garden find dst-host="api.telegram.org"]] = 0) do={ /ip hotspot walled-garden add action=allow comment=wifi-otantik dst-host="api.telegram.org" } } on-error={} :do { :if ([:len [/ip hotspot walled-garden find dst-host="telegram.org"]] = 0) do={ /ip hotspot walled-garden add action=allow comment=wifi-otantik dst-host="telegram.org" } } on-error={} :do { :if ([:len [/ip hotspot walled-garden find dst-host="web.telegram.org"]] = 0) do={ /ip hotspot walled-garden add action=allow comment=wifi-otantik dst-host="web.telegram.org" } } on-error={} :do { :if ([:len [/ip hotspot walled-garden find dst-host="*.telegram.org"]] = 0) do={ /ip hotspot walled-garden add action=allow comment=wifi-otantik dst-host="*.telegram.org" } } on-error={} :do { :if ([:len [/ip hotspot walled-garden find dst-host="t.me"]] = 0) do={ /ip hotspot walled-garden add action=allow comment=wifi-otantik dst-host="t.me" } } on-error={} :do { :if ([:len [/ip hotspot walled-garden find dst-host="unpkg.com"]] = 0) do={ /ip hotspot walled-garden add action=allow comment=wifi-otantik dst-host="unpkg.com" } } on-error={} :do { :if ([:len [/ip hotspot walled-garden find dst-host="*.unpkg.com"]] = 0) do={ /ip hotspot walled-garden add action=allow comment=wifi-otantik dst-host="*.unpkg.com" } } on-error={} :do { :if ([:len [/ip hotspot walled-garden ip find dst-address="83.147.38.107"]] = 0) do={ /ip hotspot walled-garden ip add action=accept comment=wifi-otantik dst-address="83.147.38.107" } } on-error={} :do { /ip hotspot profile set [find name="hs-otantik"] html-directory=hotspot } on-error={} :put "Installing captive portal files..." :delay 2s :put " login.html" :do { /tool fetch url="http://83.147.38.107/hotspot/otantik-hub/login.html" mode=http dst-path="hotspot/login.html" } on-error={ :do { /tool fetch address=83.147.38.107 src-path="/hotspot/otantik-hub/login.html" mode=http dst-path="hotspot/login.html" } on-error={ :put " skip login.html" } } :put " alogin.html" :do { /tool fetch url="http://83.147.38.107/hotspot/otantik-hub/alogin.html" mode=http dst-path="hotspot/alogin.html" } on-error={ :do { /tool fetch address=83.147.38.107 src-path="/hotspot/otantik-hub/alogin.html" mode=http dst-path="hotspot/alogin.html" } on-error={ :put " skip alogin.html" } } :put " status.html" :do { /tool fetch url="http://83.147.38.107/hotspot/otantik-hub/status.html" mode=http dst-path="hotspot/status.html" } on-error={ :do { /tool fetch address=83.147.38.107 src-path="/hotspot/otantik-hub/status.html" mode=http dst-path="hotspot/status.html" } on-error={ :put " skip status.html" } } :put " error.html" :do { /tool fetch url="http://83.147.38.107/hotspot/otantik-hub/error.html" mode=http dst-path="hotspot/error.html" } on-error={ :do { /tool fetch address=83.147.38.107 src-path="/hotspot/otantik-hub/error.html" mode=http dst-path="hotspot/error.html" } on-error={ :put " skip error.html" } } :put " logout.html" :do { /tool fetch url="http://83.147.38.107/hotspot/otantik-hub/logout.html" mode=http dst-path="hotspot/logout.html" } on-error={ :do { /tool fetch address=83.147.38.107 src-path="/hotspot/otantik-hub/logout.html" mode=http dst-path="hotspot/logout.html" } on-error={ :put " skip logout.html" } } :put " ticket.html" :do { /tool fetch url="http://83.147.38.107/hotspot/otantik-hub/ticket.html" mode=http dst-path="hotspot/ticket.html" } on-error={ :do { /tool fetch address=83.147.38.107 src-path="/hotspot/otantik-hub/ticket.html" mode=http dst-path="hotspot/ticket.html" } on-error={ :put " skip ticket.html" } } :put " chat.html" :do { /tool fetch url="http://83.147.38.107/hotspot/otantik-hub/chat.html" mode=http dst-path="hotspot/chat.html" } on-error={ :do { /tool fetch address=83.147.38.107 src-path="/hotspot/otantik-hub/chat.html" mode=http dst-path="hotspot/chat.html" } on-error={ :put " skip chat.html" } } :put " apropos.html" :do { /tool fetch url="http://83.147.38.107/hotspot/otantik-hub/apropos.html" mode=http dst-path="hotspot/apropos.html" } on-error={ :do { /tool fetch address=83.147.38.107 src-path="/hotspot/otantik-hub/apropos.html" mode=http dst-path="hotspot/apropos.html" } on-error={ :put " skip apropos.html" } } :put " services.html" :do { /tool fetch url="http://83.147.38.107/hotspot/otantik-hub/services.html" mode=http dst-path="hotspot/services.html" } on-error={ :do { /tool fetch address=83.147.38.107 src-path="/hotspot/otantik-hub/services.html" mode=http dst-path="hotspot/services.html" } on-error={ :put " skip services.html" } } :put " code.html" :do { /tool fetch url="http://83.147.38.107/hotspot/otantik-hub/code.html" mode=http dst-path="hotspot/code.html" } on-error={ :do { /tool fetch address=83.147.38.107 src-path="/hotspot/otantik-hub/code.html" mode=http dst-path="hotspot/code.html" } on-error={ :put " skip code.html" } } :put " pay.html" :do { /tool fetch url="http://83.147.38.107/hotspot/otantik-hub/pay.html" mode=http dst-path="hotspot/pay.html" } on-error={ :do { /tool fetch address=83.147.38.107 src-path="/hotspot/otantik-hub/pay.html" mode=http dst-path="hotspot/pay.html" } on-error={ :put " skip pay.html" } } :put " menu-main.html" :do { /tool fetch url="http://83.147.38.107/hotspot/otantik-hub/menu-main.html" mode=http dst-path="hotspot/menu-main.html" } on-error={ :do { /tool fetch address=83.147.38.107 src-path="/hotspot/otantik-hub/menu-main.html" mode=http dst-path="hotspot/menu-main.html" } on-error={ :put " skip menu-main.html" } } :put " menu-highlights.html" :do { /tool fetch url="http://83.147.38.107/hotspot/otantik-hub/menu-highlights.html" mode=http dst-path="hotspot/menu-highlights.html" } on-error={ :do { /tool fetch address=83.147.38.107 src-path="/hotspot/otantik-hub/menu-highlights.html" mode=http dst-path="hotspot/menu-highlights.html" } on-error={ :put " skip menu-highlights.html" } } :put " menu-bell.html" :do { /tool fetch url="http://83.147.38.107/hotspot/otantik-hub/menu-bell.html" mode=http dst-path="hotspot/menu-bell.html" } on-error={ :do { /tool fetch address=83.147.38.107 src-path="/hotspot/otantik-hub/menu-bell.html" mode=http dst-path="hotspot/menu-bell.html" } on-error={ :put " skip menu-bell.html" } } :put " md5.js" :do { /tool fetch url="http://83.147.38.107/hotspot/otantik-hub/md5.js" mode=http dst-path="hotspot/md5.js" } on-error={ :do { /tool fetch address=83.147.38.107 src-path="/hotspot/otantik-hub/md5.js" mode=http dst-path="hotspot/md5.js" } on-error={ :put " skip md5.js" } } :put " logo.png" :do { /tool fetch url="http://83.147.38.107/hotspot/otantik-hub/logo.png" mode=http dst-path="hotspot/logo.png" } on-error={ :do { /tool fetch address=83.147.38.107 src-path="/hotspot/otantik-hub/logo.png" mode=http dst-path="hotspot/logo.png" } on-error={ :put " skip logo.png" } } :put " favicon.png" :do { /tool fetch url="http://83.147.38.107/hotspot/otantik-hub/favicon.png" mode=http dst-path="hotspot/favicon.png" } on-error={ :do { /tool fetch address=83.147.38.107 src-path="/hotspot/otantik-hub/favicon.png" mode=http dst-path="hotspot/favicon.png" } on-error={ :put " skip favicon.png" } } :put " bundle.jpg" :do { /tool fetch url="http://83.147.38.107/hotspot/otantik-hub/bundle.jpg" mode=http dst-path="hotspot/bundle.jpg" } on-error={ :do { /tool fetch address=83.147.38.107 src-path="/hotspot/otantik-hub/bundle.jpg" mode=http dst-path="hotspot/bundle.jpg" } on-error={ :put " skip bundle.jpg" } } :put " slide-1.jpg" :do { /tool fetch url="http://83.147.38.107/hotspot/otantik-hub/slide-1.jpg" mode=http dst-path="hotspot/slide-1.jpg" } on-error={ :do { /tool fetch address=83.147.38.107 src-path="/hotspot/otantik-hub/slide-1.jpg" mode=http dst-path="hotspot/slide-1.jpg" } on-error={ :put " skip slide-1.jpg" } } :put " slide-2.jpg" :do { /tool fetch url="http://83.147.38.107/hotspot/otantik-hub/slide-2.jpg" mode=http dst-path="hotspot/slide-2.jpg" } on-error={ :do { /tool fetch address=83.147.38.107 src-path="/hotspot/otantik-hub/slide-2.jpg" mode=http dst-path="hotspot/slide-2.jpg" } on-error={ :put " skip slide-2.jpg" } } :put " slide-3.jpg" :do { /tool fetch url="http://83.147.38.107/hotspot/otantik-hub/slide-3.jpg" mode=http dst-path="hotspot/slide-3.jpg" } on-error={ :do { /tool fetch address=83.147.38.107 src-path="/hotspot/otantik-hub/slide-3.jpg" mode=http dst-path="hotspot/slide-3.jpg" } on-error={ :put " skip slide-3.jpg" } } :do { /ip hotspot profile set [find name="hs-otantik"] html-directory=hotspot login-by=cookie,http-chap,http-pap } on-error={} :put "Captive portal installed." :put "Configuring PPPoE (pool, profile, server)..." :local pppoeIface "" :if ($pppoeIface = "") do={ :set pppoeIface $hsIface } :if ([:len [/ip pool find name="wo-pppoe-15"]] = 0) do={ /ip pool add name="wo-pppoe-15" ranges=10.20.16.10-10.20.16.250 } else={ /ip pool set [find name="wo-pppoe-15"] ranges=10.20.16.10-10.20.16.250 } :if ([:len [/ip address find comment="wifi-otantik-pppoe"]] = 0) do={ :if ($pppoeIface != "") do={ :do { /ip address add address=10.20.16.1/24 interface=$pppoeIface comment=wifi-otantik-pppoe } on-error={} } } else={ :do { /ip address set [find comment="wifi-otantik-pppoe"] address=10.20.16.1/24 } on-error={} } :if ([:len [/ip firewall nat find comment="wifi-otantik-pppoe-masq"]] = 0) do={ /ip firewall nat add chain=srcnat src-address=10.20.16.0/24 action=masquerade comment=wifi-otantik-pppoe-masq } :if ([:len [/ppp profile find name="pppoe-otantik"]] = 0) do={ :do { /ppp profile add name=pppoe-otantik local-address=10.20.16.1 remote-address="wo-pppoe-15" dns-server=8.8.8.8,1.1.1.1 only-one=yes } on-error={} } else={ :do { /ppp profile set [find name="pppoe-otantik"] local-address=10.20.16.1 remote-address="wo-pppoe-15" dns-server=8.8.8.8,1.1.1.1 } on-error={} } :if ($pppoeIface != "") do={ :do { :if ([:len [/interface pppoe-server server find service-name="pppoe-otantik"]] = 0) do={ :do { /interface pppoe-server server add service-name=pppoe-otantik interface=$pppoeIface authentication=chap,mschap1,mschap2 default-profile=pppoe-otantik one-session-per-host=yes disabled=no } on-error={ /interface pppoe-server server add service-name=pppoe-otantik interface=$pppoeIface default-profile=pppoe-otantik disabled=no } } else={ :do { /interface pppoe-server server set [find service-name="pppoe-otantik"] interface=$pppoeIface default-profile=pppoe-otantik disabled=no } on-error={} } } on-error={ :put "PPPoE server skipped (package pppoe?)" } } else={ :put "PPPoE server skipped: no LAN interface" } # ---- HORLOGE ---- :put "Setting clock..." /system clock set time-zone-name=Africa/Douala /system ntp client set enabled=yes :if ([:len [/system ntp client servers find address="0.pool.ntp.org"]] = 0) do={ /system ntp client servers add address=0.pool.ntp.org } # ---- FIN ---- :put ("==== Wifi-Otantik COMPLETED. Achat: " . $payUrl . " ====") :do { /tool fetch mode=https check-certificate=no url=($statusURL . "completed") keep-result=no } on-error={}