Cek IP Dinamis: Difference between revisions
Created page with ":local dnsName "cctv.bele.net"; :local hotspotHostAddress [/ip hotspot host get [find comment="cctv.bele.net"] address]; :local dnsStaticValue [/ip dns static get [find name="cctv.bele.net"] address]; :local bot "1931317277:AAFRdZ_pexR03lA_MHmwU3_T8RCx80_Sm7s"; :local chatID "1952568357"; :if ($hotspotHostAddress != $dnsStaticValue) do={ /ip dns static set [find name="cctv.bele.net"] address=$hotspotHostAddress :local message "Nilai DNS statis telah diubah menjadi $..." |
No edit summary |
||
Line 1: | Line 1: | ||
:local dnsName "cctv.bele.net"; | :local dnsName "cctv.bele.net"; | ||
:local hotspotHostAddress [/ip hotspot host get [find comment="cctv.bele.net"] address]; | :local hotspotHostAddress [/ip hotspot host get [find comment="cctv.bele.net"] address]; | ||
:local dnsStaticValue [/ip dns static get [find name="cctv.bele.net"] address]; | :local dnsStaticValue [/ip dns static get [find name="cctv.bele.net"] address]; | ||
:local bot "1931317277:AAFRdZ_pexR03lA_MHmwU3_T8RCx80_Sm7s"; | :local bot "1931317277:AAFRdZ_pexR03lA_MHmwU3_T8RCx80_Sm7s"; | ||
:local chatID "1952568357"; | :local chatID "1952568357"; | ||
:if ($hotspotHostAddress != $dnsStaticValue) do={ | |||
:if ($hotspotHostAddress != $dnsStaticValue) do={ | |||
/ip dns static set [find name="cctv.bele.net"] address=$hotspotHostAddress | /ip dns static set [find name="cctv.bele.net"] address=$hotspotHostAddress | ||
:local message "Nilai DNS statis telah diubah menjadi $hotspotHostAddress" | :local message "Nilai DNS statis telah diubah menjadi $hotspotHostAddress" | ||
/tool fetch url=("https://api.telegram.org/bot$bot/sendMessage\?chat_id=$chatID&text=$message") keep-result=no | /tool fetch url=("https://api.telegram.org/bot$bot/sendMessage\?chat_id=$chatID&text=$message") keep-result=no | ||
} else={ | } else={ | ||
:local message "Nilai DNS statis tidak berubah: $hotspotHostAddress" | :local message "Nilai DNS statis tidak berubah: $hotspotHostAddress" | ||
/tool fetch url=("https://api.telegram.org/bot$bot/sendMessage\?chat_id=$chatID&text=$message") keep-result=no | /tool fetch url=("https://api.telegram.org/bot$bot/sendMessage\?chat_id=$chatID&text=$message") keep-result=no | ||
} | } |
Revision as of 07:31, 13 June 2023
:local dnsName "cctv.bele.net"; :local hotspotHostAddress [/ip hotspot host get [find comment="cctv.bele.net"] address]; :local dnsStaticValue [/ip dns static get [find name="cctv.bele.net"] address]; :local bot "1931317277:AAFRdZ_pexR03lA_MHmwU3_T8RCx80_Sm7s"; :local chatID "1952568357"; :if ($hotspotHostAddress != $dnsStaticValue) do={ /ip dns static set [find name="cctv.bele.net"] address=$hotspotHostAddress :local message "Nilai DNS statis telah diubah menjadi $hotspotHostAddress" /tool fetch url=("https://api.telegram.org/bot$bot/sendMessage\?chat_id=$chatID&text=$message") keep-result=no } else={ :local message "Nilai DNS statis tidak berubah: $hotspotHostAddress" /tool fetch url=("https://api.telegram.org/bot$bot/sendMessage\?chat_id=$chatID&text=$message") keep-result=no }