Saturday, August 15, 2020

BACK UP Hotspot Mikrotik Versi Webiot

Sengaja kami upload back up Hotspot setting milik kami agar dapat digunakan dengan bijak, kami dapatkan dari beberapa sumber dan dimodifikasi, terima kasih mikrotik, labkom, dan referensi lain untuk membuat/ menjaga jaringan stabil dan otomatis 

 File ini adalah rsc dari hasil export dengan menggunakan command: export compact file="webiot-backup" 


 File juga dapat dilakukan import dengan command: import file-name="webiot-backup"

Berikut daftar kode backup file rsc


# aug/16/2020 05:47:19 by RouterOS 6.47.1
# software id = 3VJW-21AK
#
# model = 750GL
# serial number = 354F0128B0B7
/interface bridge
add name=bridge1
/interface ethernet switch
set 0 mirror-source=ether1 mirror-target=ether2
/interface wireless security-profiles
set [ find default=yes ] supplicant-identity=MikroTik
/ip firewall layer7-protocol
add name=Youtube regexp="^.+(youtube.com|www.youtube.com|m.youtube.com|ytimg.c\
    om|s.ytmig.com|ytimg.l.google.com|youtube.l.google.com|i.google.com|google\
    video.com|youtu.be).*\$"
add name=webiot regexp="^.+(ical.webiot.id).*\$"
/ip hotspot profile
add dns-name=ical.webiot.id hotspot-address=192.168.31.2 login-by=\
    http-chap,http-pap,mac-cookie name=hsprof1 use-radius=yes
/ip hotspot
add addresses-per-mac=unlimited disabled=no idle-timeout=none interface=\
    bridge1 name=iCAL-hotspot profile=hsprof1
add addresses-per-mac=unlimited disabled=no idle-timeout=none interface=\
    ether5 name=iCAL-hotspot1 profile=hsprof1
/ip hotspot user profile
set [ find default=yes ] idle-timeout=1d keepalive-timeout=1d \
    mac-cookie-timeout=1d on-login="{\r\
    \n:local nama \"\$user\";\r\
    \n:local ips \"\$address\";\r\
    \n:local mac [/ip hotspot active get [find address=\"\$ips\"] mac-address]\
    ;\r\
    \n:local host [/ip dhcp-server lease get [find address=\"\$ips\"] host-nam\
    e];\r\
    \n:local lby [/ip hotspot active get [find address=\"\$ips\"] login-by];\r\
    \n:local limitIn [/ip hotspot active get [find address=\"\$ips\"] limit-by\
    tes-in];\r\
    \n:local limitOut [/ip hotspot active get [find address=\"\$ips\"] limit-b\
    ytes-out];\r\
    \n:local limIn [((\$limitIn)/1048576)];\r\
    \n:local limOut [((\$limitOut)/1048576)];\r\
    \n#:local exp [/system scheduler get [find name=\"\$nama\"] next-run];\r\
    \n:local useraktif [/ip hotspot active print count-only];\r\
    \n:local activeTime (\"Sisa waktu: \".[/ip hotspot active get [find addres\
    s=\"\$ips\"] session-time-left])\r\
    \n/tool fetch \"https://api.telegram.org/bot1391417232:AAGBb6wRz6nfzpP1F2N\
    oDlceC_FkCwVNe5A/sendMessage\?chat_id=1299622755&text=====>> Login :%0A\$n\
    ama%0A\$ips %0A\$mac%0A\$host%0Alogin-by : \$lby%0AKuota : \$limIn Mb / \$\
    limOut Mb%0A\$activeTime%0ATerhubung : \$useraktif user\" mode=http keep-r\
    esult=no;\r\
    \n/ip firewall address-list remove [find address=\"\$ips\"];\r\
    \n}" on-logout="/tool fetch url=\"https://api.telegram.org/bot1391417232:A\
    AGBb6wRz6nfzpP1F2NoDlceC_FkCwVNe5A/sendMessage\?chat_id=1299622755&text=\$\
    user Logout Sendiri || \$address\" keep-result=no"
add idle-timeout=1d keepalive-timeout=1d name=user10 on-login="{\
    \n:local nama \"\$user\";\
    \n:local ips \"\$address\";\
    \n:local mac [/ip hotspot active get [find address=\"\$ips\"] mac-address]\
    ;\
    \n:local host [/ip dhcp-server lease get [find address=\"\$ips\"] host-nam\
    e];\
    \n:local lby [/ip hotspot active get [find address=\"\$ips\"] login-by];\
    \n:local limitIn [/ip hotspot active get [find address=\"\$ips\"] limit-by\
    tes-in];\
    \n:local limitOut [/ip hotspot active get [find address=\"\$ips\"] limit-b\
    ytes-out];\
    \n:local limIn [((\$limitIn)/1048576)];\
    \n:local limOut [((\$limitOut)/1048576)];\
    \n#:local exp [/system scheduler get [find name=\"\$nama\"] next-run];\
    \n:local useraktif [/ip hotspot active print count-only];\
    \n:local activeTime (\"Sisa waktu: \".[/ip hotspot active get [find addres\
    s=\"\$ips\"] session-time-left])\
    \n/tool fetch \"https://api.telegram.org/bot1391417232:AAGBb6wRz6nfzpP1F2N\
    oDlceC_FkCwVNe5A/sendMessage\?chat_id=1299622755&text=====>> Login :%0A\$n\
    ama%0A\$ips %0A\$mac%0A\$host%0Alogin-by : \$lby%0AKuota : \$limIn Mb / \$\
    limOut Mb%0A\$activeTime%0ATerhubung : \$useraktif user\" mode=http keep-r\
    esult=no;\
    \n/ip firewall address-list remove [find address=\"\$ips\"];\
    \n}" on-logout="/tool fetch url=\"https://api.telegram.org/bot1391417232:A\
    AGBb6wRz6nfzpP1F2NoDlceC_FkCwVNe5A/sendMessage\?chat_id=1299622755&text=\$\
    user Logout Sendiri || \$address\" keep-result=no" shared-users=10 \
    status-autorefresh=1h
add idle-timeout=4w2d keepalive-timeout=1h mac-cookie-timeout=1h name=1jam \
    on-login="{\
    \n:local nama \"\$user\";\
    \n:local ips \"\$address\";\
    \n:local mac [/ip hotspot active get [find address=\"\$ips\"] mac-address]\
    ;\
    \n:local host [/ip dhcp-server lease get [find address=\"\$ips\"] host-nam\
    e];\
    \n:local lby [/ip hotspot active get [find address=\"\$ips\"] login-by];\
    \n:local limitIn [/ip hotspot active get [find address=\"\$ips\"] limit-by\
    tes-in];\
    \n:local limitOut [/ip hotspot active get [find address=\"\$ips\"] limit-b\
    ytes-out];\
    \n:local limIn [((\$limitIn)/1048576)];\
    \n:local limOut [((\$limitOut)/1048576)];\
    \n#:local exp [/system scheduler get [find name=\"\$nama\"] next-run];\
    \n:local useraktif [/ip hotspot active print count-only];\
    \n:local cekPaket [/tool user-manager user get [find username=\"\$user\"] \
    actual-profile];\
    \nif (\$cekPaket=\"Paket 1 jam habis\") do={\
    \n/tool user-manager user create-and-activate-profile profile=\"Paket 1 ja\
    m\" customer=admin numbers=\$user;\
    \n}\
    \n:local activeTime (\"Sisa waktu: \".[/ip hotspot active get [find addres\
    s=\"\$ips\"] session-time-left])\
    \n/tool fetch \"https://api.telegram.org/bot1391417232:AAGBb6wRz6nfzpP1F2N\
    oDlceC_FkCwVNe5A/sendMessage\?chat_id=1299622755&text=====>> Login :%0A\$n\
    ama%0A\$ips %0A\$mac%0A\$host%0Alogin-by : \$lby%0AKuota : \$limIn Mb / \$\
    limOut Mb%0A\$activeTime%0ATerhubung : \$useraktif user\" mode=http keep-r\
    esult=no;\
    \n/ip firewall address-list remove [find address=\"\$ips\"];\
    \n}" on-logout="{\
    \n:local cekPaket [/tool user-manager user get [find username=\"\$user\"] \
    actual-profile];\
    \nif (\$cekPaket=\"Paket 1 jam\") do={\
    \n:local hasilPaket (\"Paket utama habis\")\
    \n}\
    \n/tool fetch url=\"https://api.telegram.org/bot1391417232:AAGBb6wRz6nfzpP\
    1F2NoDlceC_FkCwVNe5A/sendMessage\?chat_id=1299622755&text=\$user Logout Se\
    ndiri || \$address%0A\$hasilPaket\" keep-result=no\
    \n}"
add idle-timeout=4w2d keepalive-timeout=3h mac-cookie-timeout=3h name=3jam \
    on-login="{\
    \n:local nama \"\$user\";\
    \n:local ips \"\$address\";\
    \n:local mac [/ip hotspot active get [find address=\"\$ips\"] mac-address]\
    ;\
    \n:local host [/ip dhcp-server lease get [find address=\"\$ips\"] host-nam\
    e];\
    \n:local lby [/ip hotspot active get [find address=\"\$ips\"] login-by];\
    \n:local limitIn [/ip hotspot active get [find address=\"\$ips\"] limit-by\
    tes-in];\
    \n:local limitOut [/ip hotspot active get [find address=\"\$ips\"] limit-b\
    ytes-out];\
    \n:local limIn [((\$limitIn)/1048576)];\
    \n:local limOut [((\$limitOut)/1048576)];\
    \n#:local exp [/system scheduler get [find name=\"\$nama\"] next-run];\
    \n:local useraktif [/ip hotspot active print count-only];\
    \n:local cekPaket [/tool user-manager user get [find username=\"\$user\"] \
    actual-profile];\
    \nif (\$cekPaket=\"Paket 3 jam habis\") do={\
    \n/tool user-manager user create-and-activate-profile profile=\"Paket 3 ja\
    m\" customer=admin numbers=\$user;\
    \n}\
    \n:local activeTime (\"Sisa waktu: \".[/ip hotspot active get [find addres\
    s=\"\$ips\"] session-time-left])\
    \n/tool fetch \"https://api.telegram.org/bot1391417232:AAGBb6wRz6nfzpP1F2N\
    oDlceC_FkCwVNe5A/sendMessage\?chat_id=1299622755&text=====>> Login :%0A\$n\
    ama%0A\$ips %0A\$mac%0A\$host%0Alogin-by : \$lby%0AKuota : \$limIn Mb / \$\
    limOut Mb%0A\$activeTime%0ATerhubung : \$useraktif user\" mode=http keep-r\
    esult=no;\
    \n/ip firewall address-list remove [find address=\"\$ips\"];\
    \n}" on-logout="{\
    \n:local cekPaket [/tool user-manager user get [find username=\"\$user\"] \
    actual-profile];\
    \nif (\$cekPaket=\"Paket 3 jam\") do={\
    \n:local hasilPaket (\"Paket utama habis\")\
    \n}\
    \n/tool fetch url=\"https://api.telegram.org/bot1391417232:AAGBb6wRz6nfzpP\
    1F2NoDlceC_FkCwVNe5A/sendMessage\?chat_id=1299622755&text=\$user Logout Se\
    ndiri || \$address%0A\$hasilPaket\" keep-result=no\
    \n}"
add idle-timeout=4w2d keepalive-timeout=5h mac-cookie-timeout=5h name=5jam \
    on-login="{\
    \n:local nama \"\$user\";\
    \n:local ips \"\$address\";\
    \n:local mac [/ip hotspot active get [find address=\"\$ips\"] mac-address]\
    ;\
    \n:local host [/ip dhcp-server lease get [find address=\"\$ips\"] host-nam\
    e];\
    \n:local lby [/ip hotspot active get [find address=\"\$ips\"] login-by];\
    \n:local limitIn [/ip hotspot active get [find address=\"\$ips\"] limit-by\
    tes-in];\
    \n:local limitOut [/ip hotspot active get [find address=\"\$ips\"] limit-b\
    ytes-out];\
    \n:local limIn [((\$limitIn)/1048576)];\
    \n:local limOut [((\$limitOut)/1048576)];\
    \n#:local exp [/system scheduler get [find name=\"\$nama\"] next-run];\
    \n:local useraktif [/ip hotspot active print count-only];\
    \n:local cekPaket [/tool user-manager user get [find username=\"\$user\"] \
    actual-profile];\
    \nif (\$cekPaket=\"Paket 5 jam habis\") do={\
    \n/tool user-manager user create-and-activate-profile profile=\"Paket 5 ja\
    m\" customer=admin numbers=\$user;\
    \n}\
    \n:local activeTime (\"Sisa waktu: \".[/ip hotspot active get [find addres\
    s=\"\$ips\"] session-time-left])\
    \n/tool fetch \"https://api.telegram.org/bot1391417232:AAGBb6wRz6nfzpP1F2N\
    oDlceC_FkCwVNe5A/sendMessage\?chat_id=1299622755&text=====>> Login :%0A\$n\
    ama%0A\$ips %0A\$mac%0A\$host%0Alogin-by : \$lby%0AKuota : \$limIn Mb / \$\
    limOut Mb%0A\$activeTime%0ATerhubung : \$useraktif user\" mode=http keep-r\
    esult=no;\
    \n/ip firewall address-list remove [find address=\"\$ips\"];\
    \n}" on-logout="{\
    \n:local cekPaket [/tool user-manager user get [find username=\"\$user\"] \
    actual-profile];\
    \nif (\$cekPaket=\"Paket 5 jam\") do={\
    \n:local hasilPaket (\"Paket utama habis\")\
    \n}\
    \n/tool fetch url=\"https://api.telegram.org/bot1391417232:AAGBb6wRz6nfzpP\
    1F2NoDlceC_FkCwVNe5A/sendMessage\?chat_id=1299622755&text=\$user Logout Se\
    ndiri || \$address%0A\$hasilPaket\" keep-result=no\
    \n}"
add idle-timeout=4w2d keepalive-timeout=1d mac-cookie-timeout=1d name=1hari \
    on-login="{\
    \n:local nama \"\$user\";\
    \n:local ips \"\$address\";\
    \n:local mac [/ip hotspot active get [find address=\"\$ips\"] mac-address]\
    ;\
    \n:local host [/ip dhcp-server lease get [find address=\"\$ips\"] host-nam\
    e];\
    \n:local lby [/ip hotspot active get [find address=\"\$ips\"] login-by];\
    \n:local limitIn [/ip hotspot active get [find address=\"\$ips\"] limit-by\
    tes-in];\
    \n:local limitOut [/ip hotspot active get [find address=\"\$ips\"] limit-b\
    ytes-out];\
    \n:local limIn [((\$limitIn)/1048576)];\
    \n:local limOut [((\$limitOut)/1048576)];\
    \n#:local exp [/system scheduler get [find name=\"\$nama\"] next-run];\
    \n:local useraktif [/ip hotspot active print count-only];\
    \n:local cekPaket [/tool user-manager user get [find username=\"\$user\"] \
    actual-profile];\
    \nif (\$cekPaket=\"Paket 1 hari habis\") do={\
    \n/tool user-manager user create-and-activate-profile profile=\"Paket 1 ha\
    ri\" customer=admin numbers=\$user;\
    \n}\
    \n:local activeTime (\"Sisa waktu: \".[/ip hotspot active get [find addres\
    s=\"\$ips\"] session-time-left])\
    \n/tool fetch \"https://api.telegram.org/bot1391417232:AAGBb6wRz6nfzpP1F2N\
    oDlceC_FkCwVNe5A/sendMessage\?chat_id=1299622755&text=====>> Login :%0A\$n\
    ama%0A\$ips %0A\$mac%0A\$host%0Alogin-by : \$lby%0AKuota : \$limIn Mb / \$\
    limOut Mb%0A\$activeTime%0ATerhubung : \$useraktif user\" mode=http keep-r\
    esult=no;\
    \n/ip firewall address-list remove [find address=\"\$ips\"];\
    \n}" on-logout="{\
    \n:local cekPaket [/tool user-manager user get [find username=\"\$user\"] \
    actual-profile];\
    \nif (\$cekPaket=\"Paket 1 hari\") do={\
    \n:local hasilPaket (\"Paket utama habis\")\
    \n}\
    \n/tool fetch url=\"https://api.telegram.org/bot1391417232:AAGBb6wRz6nfzpP\
    1F2NoDlceC_FkCwVNe5A/sendMessage\?chat_id=1299622755&text=\$user Logout Se\
    ndiri || \$address%0A\$hasilPaket\" keep-result=no\
    \n}"
add idle-timeout=4w2d keepalive-timeout=1w mac-cookie-timeout=1w name=1minggu \
    on-login="{\
    \n:local nama \"\$user\";\
    \n:local ips \"\$address\";\
    \n:local mac [/ip hotspot active get [find address=\"\$ips\"] mac-address]\
    ;\
    \n:local host [/ip dhcp-server lease get [find address=\"\$ips\"] host-nam\
    e];\
    \n:local lby [/ip hotspot active get [find address=\"\$ips\"] login-by];\
    \n:local limitIn [/ip hotspot active get [find address=\"\$ips\"] limit-by\
    tes-in];\
    \n:local limitOut [/ip hotspot active get [find address=\"\$ips\"] limit-b\
    ytes-out];\
    \n:local limIn [((\$limitIn)/1048576)];\
    \n:local limOut [((\$limitOut)/1048576)];\
    \n#:local exp [/system scheduler get [find name=\"\$nama\"] next-run];\
    \n:local useraktif [/ip hotspot active print count-only];\
    \n:local cekPaket [/tool user-manager user get [find username=\"\$user\"] \
    actual-profile];\
    \nif (\$cekPaket=\"Paket 1 Minggu habis\") do={\
    \n/tool user-manager user create-and-activate-profile profile=\"Paket 1 Mi\
    nggu\" customer=admin numbers=\$user;\
    \n}\
    \n:local activeTime (\"Sisa waktu: \".[/ip hotspot active get [find addres\
    s=\"\$ips\"] session-time-left])\
    \n/tool fetch \"https://api.telegram.org/bot1391417232:AAGBb6wRz6nfzpP1F2N\
    oDlceC_FkCwVNe5A/sendMessage\?chat_id=1299622755&text=====>> Login :%0A\$n\
    ama%0A\$ips %0A\$mac%0A\$host%0Alogin-by : \$lby%0AKuota : \$limIn Mb / \$\
    limOut Mb%0A\$activeTime%0ATerhubung : \$useraktif user\" mode=http keep-r\
    esult=no;\
    \n/ip firewall address-list remove [find address=\"\$ips\"];\
    \n}" on-logout="{\
    \n:local cekPaket [/tool user-manager user get [find username=\"\$user\"] \
    actual-profile];\
    \nif (\$cekPaket=\"Paket 1 Minggu\") do={\
    \n:local hasilPaket (\"Paket utama habis\")\
    \n}\
    \n/tool fetch url=\"https://api.telegram.org/bot1391417232:AAGBb6wRz6nfzpP\
    1F2NoDlceC_FkCwVNe5A/sendMessage\?chat_id=1299622755&text=\$user Logout Se\
    ndiri || \$address%0A\$hasilPaket\" keep-result=no\
    \n}"
add idle-timeout=4w2d keepalive-timeout=4w2d mac-cookie-timeout=4w2d name=\
    1bulan on-login="{\
    \n:local nama \"\$user\";\
    \n:local ips \"\$address\";\
    \n:local mac [/ip hotspot active get [find address=\"\$ips\"] mac-address]\
    ;\
    \n:local host [/ip dhcp-server lease get [find address=\"\$ips\"] host-nam\
    e];\
    \n:local lby [/ip hotspot active get [find address=\"\$ips\"] login-by];\
    \n:local limitIn [/ip hotspot active get [find address=\"\$ips\"] limit-by\
    tes-in];\
    \n:local limitOut [/ip hotspot active get [find address=\"\$ips\"] limit-b\
    ytes-out];\
    \n:local limIn [((\$limitIn)/1048576)];\
    \n:local limOut [((\$limitOut)/1048576)];\
    \n#:local exp [/system scheduler get [find name=\"\$nama\"] next-run];\
    \n:local useraktif [/ip hotspot active print count-only];\
    \n:local cekPaket [/tool user-manager user get [find username=\"\$user\"] \
    actual-profile];\
    \nif (\$cekPaket=\"Paket 1 Bulan habis\") do={\
    \n/tool user-manager user create-and-activate-profile profile=\"Paket 1 Bu\
    lan\" customer=admin numbers=\$user;\
    \n}\
    \n:local activeTime (\"Sisa waktu: \".[/ip hotspot active get [find addres\
    s=\"\$ips\"] session-time-left])\
    \n/tool fetch \"https://api.telegram.org/bot1391417232:AAGBb6wRz6nfzpP1F2N\
    oDlceC_FkCwVNe5A/sendMessage\?chat_id=1299622755&text=====>> Login :%0A\$n\
    ama%0A\$ips %0A\$mac%0A\$host%0Alogin-by : \$lby%0AKuota : \$limIn Mb / \$\
    limOut Mb%0A\$activeTime%0ATerhubung : \$useraktif user\" mode=http keep-r\
    esult=no;\
    \n/ip firewall address-list remove [find address=\"\$ips\"];\
    \n}" on-logout="{\
    \n:local cekPaket [/tool user-manager user get [find username=\"\$user\"] \
    actual-profile];\
    \nif (\$cekPaket=\"Paket 1 Bulan\") do={\
    \n:local hasilPaket (\"Paket utama habis\")\
    \n}\
    \n/tool fetch url=\"https://api.telegram.org/bot1391417232:AAGBb6wRz6nfzpP\
    1F2NoDlceC_FkCwVNe5A/sendMessage\?chat_id=1299622755&text=\$user Logout Se\
    ndiri || \$address%0A\$hasilPaket\" keep-result=no\
    \n}"
add idle-timeout=1d keepalive-timeout=5m mac-cookie-timeout=5m name=gratis \
    on-login="{\
    \n:local nama \"\$user\";\
    \n:local ips \"\$address\";\
    \n:local mac [/ip hotspot active get [find address=\"\$ips\"] mac-address]\
    ;\
    \n:local host [/ip dhcp-server lease get [find address=\"\$ips\"] host-nam\
    e];\
    \n:local lby [/ip hotspot active get [find address=\"\$ips\"] login-by];\
    \n:local limitIn [/ip hotspot active get [find address=\"\$ips\"] limit-by\
    tes-in];\
    \n:local limitOut [/ip hotspot active get [find address=\"\$ips\"] limit-b\
    ytes-out];\
    \n:local limIn [((\$limitIn)/1048576)];\
    \n:local limOut [((\$limitOut)/1048576)];\
    \n#:local exp [/system scheduler get [find name=\"\$nama\"] next-run];\
    \n:local useraktif [/ip hotspot active print count-only];\
    \n:local cekPaket [/tool user-manager user get [find username=\"\$user\"] \
    actual-profile];\
    \nif (\$cekPaket=\"Paket Gratis habis\") do={\
    \n/tool user-manager user create-and-activate-profile profile=\"Paket Grat\
    is\" customer=admin numbers=\$user;\
    \n}\
    \n:local activeTime (\"Sisa waktu: \".[/ip hotspot active get [find addres\
    s=\"\$ips\"] session-time-left])\
    \n/tool fetch \"https://api.telegram.org/bot1391417232:AAGBb6wRz6nfzpP1F2N\
    oDlceC_FkCwVNe5A/sendMessage\?chat_id=1299622755&text=====>> Login :%0A\$n\
    ama%0A\$ips %0A\$mac%0A\$host%0Alogin-by : \$lby%0AKuota : \$limIn Mb / \$\
    limOut Mb%0A\$activeTime%0ATerhubung : \$useraktif user\" mode=http keep-r\
    esult=no;\
    \n/ip firewall address-list remove [find address=\"\$ips\"];\
    \n}" on-logout="{\
    \n:local cekPaket [/tool user-manager user get [find username=\"\$user\"] \
    actual-profile];\
    \nif (\$cekPaket=\"Paket Gratis\") do={\
    \n:local hasilPaket (\"Paket utama habis\")\
    \n}\
    \n/tool fetch url=\"https://api.telegram.org/bot1391417232:AAGBb6wRz6nfzpP\
    1F2NoDlceC_FkCwVNe5A/sendMessage\?chat_id=1299622755&text=\$user Logout Se\
    ndiri || \$address%0A\$hasilPaket\" keep-result=no\
    \n}" shared-users=10
add idle-timeout=4w2d keepalive-timeout=4w2d mac-cookie-timeout=4w2d name=\
    1bulanmin on-login="{\
    \n:local nama \"\$user\";\
    \n:local ips \"\$address\";\
    \n:local mac [/ip hotspot active get [find address=\"\$ips\"] mac-address]\
    ;\
    \n:local host [/ip dhcp-server lease get [find address=\"\$ips\"] host-nam\
    e];\
    \n:local lby [/ip hotspot active get [find address=\"\$ips\"] login-by];\
    \n:local limitIn [/ip hotspot active get [find address=\"\$ips\"] limit-by\
    tes-in];\
    \n:local limitOut [/ip hotspot active get [find address=\"\$ips\"] limit-b\
    ytes-out];\
    \n:local limIn [((\$limitIn)/1048576)];\
    \n:local limOut [((\$limitOut)/1048576)];\
    \n#:local exp [/system scheduler get [find name=\"\$nama\"] next-run];\
    \n:local useraktif [/ip hotspot active print count-only];\
    \n:local cekPaket [/tool user-manager user get [find username=\"\$user\"] \
    actual-profile];\
    \nif (\$cekPaket=\"Paket 1 Bulan min habis\") do={\
    \n/tool user-manager user create-and-activate-profile profile=\"Paket 1 Bu\
    lan min\" customer=admin numbers=\$user;\
    \n}\
    \n:local activeTime (\"Sisa waktu: \".[/ip hotspot active get [find addres\
    s=\"\$ips\"] session-time-left])\
    \n/tool fetch \"https://api.telegram.org/bot1391417232:AAGBb6wRz6nfzpP1F2N\
    oDlceC_FkCwVNe5A/sendMessage\?chat_id=1299622755&text=====>> Login :%0A\$n\
    ama%0A\$ips %0A\$mac%0A\$host%0Alogin-by : \$lby%0AKuota : \$limIn Mb / \$\
    limOut Mb%0A\$activeTime%0ATerhubung : \$useraktif user\" mode=http keep-r\
    esult=no;\
    \n/ip firewall address-list remove [find address=\"\$ips\"];\
    \n}" on-logout="{\
    \n:local cekPaket [/tool user-manager user get [find username=\"\$user\"] \
    actual-profile];\
    \nif (\$cekPaket=\"Paket 1 Bulan min\") do={\
    \n:local hasilPaket (\"Paket utama habis\")\
    \n}\
    \n/tool fetch url=\"https://api.telegram.org/bot1391417232:AAGBb6wRz6nfzpP\
    1F2NoDlceC_FkCwVNe5A/sendMessage\?chat_id=1299622755&text=\$user Logout Se\
    ndiri || \$address%0A\$hasilPaket\" keep-result=no\
    \n}"
add idle-timeout=4w2d keepalive-timeout=4w2d mac-cookie-timeout=4w2d name=\
    1bulanmax on-login="{\
    \n:local nama \"\$user\";\
    \n:local ips \"\$address\";\
    \n:local mac [/ip hotspot active get [find address=\"\$ips\"] mac-address]\
    ;\
    \n:local host [/ip dhcp-server lease get [find address=\"\$ips\"] host-nam\
    e];\
    \n:local lby [/ip hotspot active get [find address=\"\$ips\"] login-by];\
    \n:local limitIn [/ip hotspot active get [find address=\"\$ips\"] limit-by\
    tes-in];\
    \n:local limitOut [/ip hotspot active get [find address=\"\$ips\"] limit-b\
    ytes-out];\
    \n:local limIn [((\$limitIn)/1048576)];\
    \n:local limOut [((\$limitOut)/1048576)];\
    \n#:local exp [/system scheduler get [find name=\"\$nama\"] next-run];\
    \n:local useraktif [/ip hotspot active print count-only];\
    \n:local cekPaket [/tool user-manager user get [find username=\"\$user\"] \
    actual-profile];\
    \nif (\$cekPaket=\"Paket 1 Bulan max habis\") do={\
    \n/tool user-manager user create-and-activate-profile profile=\"Paket 1 Bu\
    lan max\" customer=admin numbers=\$user;\
    \n}\
    \n:local activeTime (\"Sisa waktu: \".[/ip hotspot active get [find addres\
    s=\"\$ips\"] session-time-left])\
    \n/tool fetch \"https://api.telegram.org/bot1391417232:AAGBb6wRz6nfzpP1F2N\
    oDlceC_FkCwVNe5A/sendMessage\?chat_id=1299622755&text=====>> Login :%0A\$n\
    ama%0A\$ips %0A\$mac%0A\$host%0Alogin-by : \$lby%0AKuota : \$limIn Mb / \$\
    limOut Mb%0A\$activeTime%0ATerhubung : \$useraktif user\" mode=http keep-r\
    esult=no;\
    \n/ip firewall address-list remove [find address=\"\$ips\"];\
    \n}" on-logout="{\
    \n:local cekPaket [/tool user-manager user get [find username=\"\$user\"] \
    actual-profile];\
    \nif (\$cekPaket=\"Paket 1 Bulan max\") do={\
    \n:local hasilPaket (\"Paket utama habis\")\
    \n}\
    \n/tool fetch url=\"https://api.telegram.org/bot1391417232:AAGBb6wRz6nfzpP\
    1F2NoDlceC_FkCwVNe5A/sendMessage\?chat_id=1299622755&text=\$user Logout Se\
    ndiri || \$address%0A\$hasilPaket\" keep-result=no\
    \n}" shared-users=3
add idle-timeout=1w keepalive-timeout=1w mac-cookie-timeout=1w name=user3 \
    on-login="{\
    \n:local nama \"\$user\";\
    \n:local ips \"\$address\";\
    \n:local mac [/ip hotspot active get [find address=\"\$ips\"] mac-address]\
    ;\
    \n:local host [/ip dhcp-server lease get [find address=\"\$ips\"] host-nam\
    e];\
    \n:local lby [/ip hotspot active get [find address=\"\$ips\"] login-by];\
    \n:local limitIn [/ip hotspot active get [find address=\"\$ips\"] limit-by\
    tes-in];\
    \n:local limitOut [/ip hotspot active get [find address=\"\$ips\"] limit-b\
    ytes-out];\
    \n:local limIn [((\$limitIn)/1048576)];\
    \n:local limOut [((\$limitOut)/1048576)];\
    \n#:local exp [/system scheduler get [find name=\"\$nama\"] next-run];\
    \n:local useraktif [/ip hotspot active print count-only];\
    \n:local activeTime (\"Sisa waktu: \".[/ip hotspot active get [find addres\
    s=\"\$ips\"] session-time-left])\
    \n/tool fetch \"https://api.telegram.org/bot1391417232:AAGBb6wRz6nfzpP1F2N\
    oDlceC_FkCwVNe5A/sendMessage\?chat_id=1299622755&text=====>> Login :%0A\$n\
    ama%0A\$ips %0A\$mac%0A\$host%0Alogin-by : \$lby%0AKuota : \$limIn Mb / \$\
    limOut Mb%0A\$activeTime%0ATerhubung : \$useraktif user\" mode=http keep-r\
    esult=no;\
    \n/ip firewall address-list remove [find address=\"\$ips\"];\
    \n}" on-logout="/tool fetch url=\"https://api.telegram.org/bot1391417232:A\
    AGBb6wRz6nfzpP1F2NoDlceC_FkCwVNe5A/sendMessage\?chat_id=1299622755&text=\$\
    user Logout Sendiri || \$address\" keep-result=no" shared-users=3
/ip pool
add name=dhcp_pool0 ranges=192.168.1.3-192.168.1.254
add name=dhcp_pool4 ranges=192.168.2.2-192.168.2.254
add name=dhcp_pool5 ranges=192.168.31.3-192.168.31.254
/ip dhcp-server
add address-pool=dhcp_pool4 disabled=no interface=ether5 lease-time=1d name=\
    dhcp1
add address-pool=dhcp_pool5 disabled=no interface=bridge1 lease-time=1d name=\
    dhcp2
/lora servers
add address=eu.mikrotik.thethings.industries down-port=1700 name=TTN-EU \
    up-port=1700
add address=us.mikrotik.thethings.industries down-port=1700 name=TTN-US \
    up-port=1700
/queue simple
add limit-at=1M/5M max-limit=1M/5M name=Toko packet-marks=Toko target=ether3
add limit-at=512k/512k max-limit=512k/512k name=iCAL packet-marks=iCAL \
    parent=Toko target=192.168.31.252/32
add limit-at=1k/1k max-limit=1k/1k name=black packet-marks=black parent=Toko \
    target=ether3 total-max-limit=1M
/system logging action
set 0 memory-lines=50
set 1 disk-lines-per-file=20
/tool user-manager customer
set admin access=\
    own-routers,own-users,own-profiles,own-limits,config-payment-gw city=\
    TANGERANG company=WEBIOT.ID country=INDONESIA email=ahroihan@gmail.com \
    password=ar!0041987NM public-host=ical-hotspot.webiot.id public-id=iCAL
/tool user-manager profile
add name=admin name-for-users=admin override-shared-users=unlimited owner=\
    admin price=0 starts-at=logon validity=0s
add name="Paket 500 MB" name-for-users=500mb override-shared-users=off owner=\
    admin price=5000 starts-at=logon validity=2d
add name="Paket 1 GB" name-for-users=1gb override-shared-users=3 owner=admin \
    price=10000 starts-at=logon validity=1w
add name="Paket 1 jam" name-for-users=1jam override-shared-users=off owner=\
    admin price=1000 starts-at=logon validity=1h
add name="Paket 3 jam" name-for-users=3jam override-shared-users=off owner=\
    admin price=3000 starts-at=logon validity=3h
add name="Paket 5 jam" name-for-users=5jam override-shared-users=off owner=\
    admin price=5000 starts-at=logon validity=5h
add name="Paket 1 hari" name-for-users=1hari override-shared-users=off owner=\
    admin price=10000 starts-at=logon validity=1d
add name="Paket 1 Minggu" name-for-users=1minggu override-shared-users=off \
    owner=admin price=20000 starts-at=logon validity=1w
add name="Paket 1 Bulan" name-for-users=1bulan override-shared-users=off \
    owner=admin price=60000 starts-at=logon validity=4w2d
add name="Paket Gratis" name-for-users=gratis override-shared-users=off \
    owner=admin price=0 starts-at=logon validity=5m
add name="Paket Gratis habis" name-for-users=gratishabis \
    override-shared-users=off owner=admin price=0 starts-at=logon validity=1d
add name="Paket 1 jam habis" name-for-users=1jamhabis override-shared-users=\
    off owner=admin price=0 starts-at=logon validity=1h
add name="Paket 3 jam habis" name-for-users=3jamhabis override-shared-users=\
    off owner=admin price=0 starts-at=logon validity=3h
add name="Paket 5 jam habis" name-for-users=5jamhabis override-shared-users=\
    off owner=admin price=0 starts-at=logon validity=5h
add name="Paket 1 hari habis" name-for-users=1harihabis \
    override-shared-users=off owner=admin price=0 starts-at=logon validity=1d
add name="Paket 1 Minggu habis" name-for-users=1mingguhabis \
    override-shared-users=off owner=admin price=0 starts-at=logon validity=1w
add name="Paket 1 Bulan habis" name-for-users=1bulanhabis \
    override-shared-users=off owner=admin price=0 starts-at=logon validity=\
    4w2d
add name="Paket 1 Bulan min" name-for-users=1bulanmin override-shared-users=\
    off owner=admin price=30000 starts-at=logon validity=4w2d
add name="Paket 1 Bulan min habis" name-for-users=1bulanminhabis \
    override-shared-users=off owner=admin price=0 starts-at=logon validity=\
    4w2d
add name="Paket 1 Bulan max" name-for-users=1bulanmax override-shared-users=3 \
    owner=admin price=100000 starts-at=logon validity=4w2d
add name="Paket 1 Bulan max habis" name-for-users=1bulanmaxhabis \
    override-shared-users=3 owner=admin price=0 starts-at=logon validity=4w2d
/tool user-manager profile limitation
add address-list="" download-limit=524288000B group-name="" ip-pool="" \
    ip-pool6="" name="Paket 500 MB" owner=admin rate-limit-min-rx=524288B \
    rate-limit-min-tx=1048576B rate-limit-rx=524288B rate-limit-tx=1048576B \
    transfer-limit=0B upload-limit=104857600B uptime-limit=2d
add address-list="" download-limit=1073741824B group-name=user3 ip-pool="" \
    ip-pool6="" name="Paket 1 GB" owner=admin rate-limit-min-rx=524288B \
    rate-limit-min-tx=1048576B rate-limit-rx=524288B rate-limit-tx=1048576B \
    transfer-limit=0B upload-limit=314572800B uptime-limit=1w
add address-list="" download-limit=104857600B group-name=1jam ip-pool="" \
    ip-pool6="" name="Paket 1 jam" owner=admin rate-limit-min-rx=65536B \
    rate-limit-min-tx=65536B rate-limit-rx=256000B rate-limit-tx=256000B \
    transfer-limit=0B upload-limit=52428800B uptime-limit=1h
add address-list="" download-limit=314572800B group-name=3jam ip-pool="" \
    ip-pool6="" name="Paket 3 jam" owner=admin rate-limit-min-rx=65536B \
    rate-limit-min-tx=65536B rate-limit-rx=256000B rate-limit-tx=256000B \
    transfer-limit=0B upload-limit=78643200B uptime-limit=3h
add address-list="" download-limit=524288000B group-name=5jam ip-pool="" \
    ip-pool6="" name="Paket 5 jam" owner=admin rate-limit-min-rx=65536B \
    rate-limit-min-tx=65536B rate-limit-rx=256000B rate-limit-tx=256000B \
    transfer-limit=0B upload-limit=104857600B uptime-limit=5h
add address-list="" download-limit=1073741824B group-name=1hari ip-pool="" \
    ip-pool6="" name="Paket 1 hari" owner=admin rate-limit-min-rx=65536B \
    rate-limit-min-tx=65536B rate-limit-rx=256000B rate-limit-tx=256000B \
    transfer-limit=0B upload-limit=314572800B uptime-limit=1d
add address-list="" download-limit=3221225472B group-name=1minggu ip-pool="" \
    ip-pool6="" name="Paket 1 Minggu" owner=admin rate-limit-min-rx=65536B \
    rate-limit-min-tx=65536B rate-limit-rx=262144B rate-limit-tx=262144B \
    transfer-limit=0B upload-limit=1073741824B uptime-limit=1w
add address-list="" download-limit=16106127360B group-name=1bulan ip-pool="" \
    ip-pool6="" name="Paket 1 Bulan" owner=admin rate-limit-min-rx=65536B \
    rate-limit-min-tx=65536B rate-limit-rx=256000B rate-limit-tx=256000B \
    transfer-limit=0B upload-limit=5368709120B uptime-limit=4w2d
add address-list="" download-limit=0B group-name=user10 ip-pool="" ip-pool6=\
    "" name=admin owner=admin transfer-limit=0B upload-limit=0B uptime-limit=\
    0s
add address-list="" download-limit=52428800B group-name=gratis ip-pool="" \
    ip-pool6="" name="Paket Gratis" owner=admin rate-limit-min-rx=65536B \
    rate-limit-min-tx=65536B rate-limit-rx=524288B rate-limit-tx=1048576B \
    transfer-limit=0B upload-limit=10485760B uptime-limit=1d
add address-list="" download-limit=0B group-name=gratis ip-pool="" ip-pool6=\
    "" name="Paket Gratis habis" owner=admin rate-limit-min-rx=65536B \
    rate-limit-min-tx=65536B rate-limit-priority=8 rate-limit-rx=65536B \
    rate-limit-tx=65536B transfer-limit=0B upload-limit=0B uptime-limit=1d
add address-list="" download-limit=0B group-name=1jam ip-pool="" ip-pool6="" \
    name="Paket 1 jam habis" owner=admin rate-limit-min-rx=65536B \
    rate-limit-min-tx=65536B rate-limit-rx=65536B rate-limit-tx=65536B \
    transfer-limit=0B upload-limit=0B uptime-limit=1h
add address-list="" download-limit=0B group-name=3jam ip-pool="" ip-pool6="" \
    name="Paket 3 jam habis" owner=admin rate-limit-min-rx=65536B \
    rate-limit-min-tx=65536B rate-limit-rx=65536B rate-limit-tx=65536B \
    transfer-limit=0B upload-limit=0B uptime-limit=3h
add address-list="" download-limit=0B group-name=5jam ip-pool="" ip-pool6="" \
    name="Paket 5 jam habis" owner=admin rate-limit-min-rx=65536B \
    rate-limit-min-tx=65536B rate-limit-rx=65536B rate-limit-tx=65536B \
    transfer-limit=0B upload-limit=0B uptime-limit=5h
add address-list="" download-limit=0B group-name=1hari ip-pool="" ip-pool6="" \
    name="Paket 1 hari habis" owner=admin rate-limit-min-rx=65536B \
    rate-limit-min-tx=65536B rate-limit-rx=65536B rate-limit-tx=65536B \
    transfer-limit=0B upload-limit=0B uptime-limit=1d
add address-list="" download-limit=0B group-name=1minggu ip-pool="" ip-pool6=\
    "" name="Paket 1 Minggu habis" owner=admin rate-limit-min-rx=65536B \
    rate-limit-min-tx=65536B rate-limit-rx=65536B rate-limit-tx=65536B \
    transfer-limit=0B upload-limit=0B uptime-limit=1w
add address-list="" download-limit=0B group-name=1bulan ip-pool="" ip-pool6=\
    "" name="Paket 1 Bulan habis" owner=admin rate-limit-min-rx=65536B \
    rate-limit-min-tx=65536B rate-limit-rx=65536B rate-limit-tx=65536B \
    transfer-limit=0B upload-limit=0B uptime-limit=4w2d
add address-list="" download-limit=10737418240B group-name=1bulanmin ip-pool=\
    "" ip-pool6="" name="Paket 1 Bulan min" owner=admin rate-limit-min-rx=\
    65536B rate-limit-min-tx=65536B rate-limit-rx=262144B rate-limit-tx=\
    262144B transfer-limit=0B upload-limit=3221225472B uptime-limit=4w2d
add address-list="" download-limit=0B group-name=1bulanmin ip-pool="" \
    ip-pool6="" name="Paket 1 Bulan min habis" owner=admin rate-limit-min-rx=\
    65536B rate-limit-min-tx=65536B rate-limit-rx=65536B rate-limit-tx=65536B \
    transfer-limit=0B upload-limit=0B uptime-limit=4w2d
add address-list="" download-limit=32212254720B group-name=1bulanmax ip-pool=\
    "" ip-pool6="" name="Paket 1 Bulan max" owner=admin rate-limit-min-rx=\
    65536B rate-limit-min-tx=65536B rate-limit-rx=524288B rate-limit-tx=\
    524288B transfer-limit=0B upload-limit=10737418240B uptime-limit=4w2d
add address-list="" download-limit=0B group-name=1bulanmax ip-pool="" \
    ip-pool6="" name="Paket 1 Bulan max habis" owner=admin rate-limit-min-rx=\
    65536B rate-limit-min-tx=65536B rate-limit-rx=65536B rate-limit-tx=65536B \
    transfer-limit=0B upload-limit=0B uptime-limit=4w2d
/interface bridge port
add bridge=bridge1 interface=ether4
add bridge=bridge1 interface=ether3
/ip address
add address=192.168.2.1/24 disabled=yes interface=bridge1 network=192.168.2.0
add address=192.168.1.2/24 interface=ether1 network=192.168.1.0
add address=192.168.31.2/24 interface=bridge1 network=192.168.31.0
add address=192.168.2.1/24 interface=ether5 network=192.168.2.0
add address=192.168.28.100/24 interface=ether2 network=192.168.28.0
/ip dhcp-server lease
add address=192.168.31.252 client-id=1:cc:9f:7a:ce:ae:4a mac-address=\
    CC:9F:7A:CE:AE:4A server=dhcp2
add address=192.168.31.253 client-id=1:7c:e9:d3:29:21:b7 mac-address=\
    7C:E9:D3:29:21:B7 server=dhcp2
add address=192.168.31.254 client-id=1:8e:53:c3:7:93:8b disabled=yes \
    mac-address=8E:53:C3:07:93:8B server=dhcp2
add address=192.168.31.254 client-id=1:28:d1:27:1b:27:7c mac-address=\
    28:D1:27:1B:27:7C server=dhcp2 use-src-mac=yes
add address=192.168.31.251 client-id=1:44:46:87:7d:e5:b5 mac-address=\
    44:46:87:7D:E5:B5 server=dhcp2
add address=192.168.31.250 mac-address=00:0A:00:78:6E:28 server=dhcp2 \
    use-src-mac=yes
/ip dhcp-server network
add address=192.168.2.0/24 dns-server=192.168.1.1,8.8.8.8 gateway=192.168.2.1
add address=192.168.4.0/24 comment="hotspot network" gateway=192.168.4.1
add address=192.168.31.0/24 dns-server=8.8.8.8,8.8.4.4 gateway=192.168.31.2
/ip dns
set servers=8.8.8.8,192.168.1.1
/ip firewall address-list
add address=192.168.1.1 list=server
add address=192.168.31.0/24 list=private-lokal
add address=69.171.250.60 disabled=yes list=WHATSAPP
add address=69.171.250.61 disabled=yes list=WHATSAPP
add address=31.13.88.61 disabled=yes list=WHATSAPP
add address=34.194.71.217 disabled=yes list=WHATSAPP
add address=157.240.217.60 disabled=yes list=WHATSAPP
add address=157.240.218.60 disabled=yes list=WHATSAPP
add address=31.13.64.51 disabled=yes list=WHATSAPP
add address=31.13.65.49 disabled=yes list=WHATSAPP
add address=31.13.66.49 disabled=yes list=WHATSAPP
add address=31.13.67.51 disabled=yes list=WHATSAPP
add address=31.13.68.52 disabled=yes list=WHATSAPP
add address=31.13.69.240 disabled=yes list=WHATSAPP
add address=31.13.70.49 disabled=yes list=WHATSAPP
add address=31.13.71.49 disabled=yes list=WHATSAPP
add address=31.13.72.52 disabled=yes list=WHATSAPP
add address=31.13.73.49 disabled=yes list=WHATSAPP
add address=31.13.74.49 disabled=yes list=WHATSAPP
add address=31.13.75.52 disabled=yes list=WHATSAPP
add address=31.13.76.81 disabled=yes list=WHATSAPP
add address=31.13.77.49 disabled=yes list=WHATSAPP
add address=31.13.78.53 disabled=yes list=WHATSAPP
add address=31.13.80.53 disabled=yes list=WHATSAPP
add address=31.13.81.53 disabled=yes list=WHATSAPP
add address=31.13.82.51 disabled=yes list=WHATSAPP
add address=31.13.83.51 disabled=yes list=WHATSAPP
add address=31.13.84.51 disabled=yes list=WHATSAPP
add address=31.13.85.51 disabled=yes list=WHATSAPP
add address=31.13.86.51 disabled=yes list=WHATSAPP
add address=31.13.87.51 disabled=yes list=WHATSAPP
add address=31.13.88.49 disabled=yes list=WHATSAPP
add address=31.13.90.51 disabled=yes list=WHATSAPP
add address=31.13.91.51 disabled=yes list=WHATSAPP
add address=31.13.92.52 disabled=yes list=WHATSAPP
add address=31.13.93.51 disabled=yes list=WHATSAPP
add address=31.13.94.52 disabled=yes list=WHATSAPP
add address=31.13.95.63 disabled=yes list=WHATSAPP
add address=50.22.198.204/30 disabled=yes list=WHATSAPP
add address=50.22.210.32/30 disabled=yes list=WHATSAPP
add address=50.22.210.128/27 disabled=yes list=WHATSAPP
add address=50.22.225.64/27 disabled=yes list=WHATSAPP
add address=50.22.235.248/30 disabled=yes list=WHATSAPP
add address=50.22.240.160/27 disabled=yes list=WHATSAPP
add address=50.23.90.128/27 disabled=yes list=WHATSAPP
add address=50.97.57.128/27 disabled=yes list=WHATSAPP
add address=75.126.39.32/27 disabled=yes list=WHATSAPP
add address=108.168.171.224/27 disabled=yes list=WHATSAPP
add address=108.168.174.0/27 disabled=yes list=WHATSAPP
add address=108.168.176.192/26 disabled=yes list=WHATSAPP
add address=108.168.177.0/27 disabled=yes list=WHATSAPP
add address=108.168.180.96/27 disabled=yes list=WHATSAPP
add address=108.168.254.65 disabled=yes list=WHATSAPP
add address=108.168.255.224 disabled=yes list=WHATSAPP
add address=108.168.255.227 disabled=yes list=WHATSAPP
add address=157.240.0.53 disabled=yes list=WHATSAPP
add address=157.240.1.53 disabled=yes list=WHATSAPP
add address=157.240.2.53 disabled=yes list=WHATSAPP
add address=157.240.3.53 disabled=yes list=WHATSAPP
add address=157.240.7.54 disabled=yes list=WHATSAPP
add address=157.240.8.53 disabled=yes list=WHATSAPP
add address=158.85.0.96/27 disabled=yes list=WHATSAPP
add address=158.85.5.192/27 disabled=yes list=WHATSAPP
add address=158.85.46.128/27 disabled=yes list=WHATSAPP
add address=158.85.48.224/27 disabled=yes list=WHATSAPP
add address=158.85.58.0/25 disabled=yes list=WHATSAPP
add address=158.85.61.192/27 disabled=yes list=WHATSAPP
add address=158.85.224.160/27 disabled=yes list=WHATSAPP
add address=158.85.233.32/27 disabled=yes list=WHATSAPP
add address=158.85.249.128/27 disabled=yes list=WHATSAPP
add address=158.85.254.64/27 disabled=yes list=WHATSAPP
add address=169.44.23.192/27 disabled=yes list=WHATSAPP
add address=169.44.36.0/25 disabled=yes list=WHATSAPP
add address=169.44.57.64/27 disabled=yes list=WHATSAPP
add address=169.44.58.64/27 disabled=yes list=WHATSAPP
add address=169.44.80.0/26 disabled=yes list=WHATSAPP
add address=169.44.82.96/27 disabled=yes list=WHATSAPP
add address=169.44.82.128/27 disabled=yes list=WHATSAPP
add address=169.44.82.192/26 disabled=yes list=WHATSAPP
add address=169.44.83.0/26 disabled=yes list=WHATSAPP
add address=169.44.83.96/27 disabled=yes list=WHATSAPP
add address=169.44.83.128/27 disabled=yes list=WHATSAPP
add address=169.44.83.192/26 disabled=yes list=WHATSAPP
add address=169.44.84.0/24 disabled=yes list=WHATSAPP
add address=169.44.85.64/27 disabled=yes list=WHATSAPP
add address=169.44.87.160/27 disabled=yes list=WHATSAPP
add address=169.45.71.32/27 disabled=yes list=WHATSAPP
add address=169.45.71.96/27 disabled=yes list=WHATSAPP
add address=169.45.87.128/26 disabled=yes list=WHATSAPP
add address=169.45.169.192/27 disabled=yes list=WHATSAPP
add address=169.45.182.96/27 disabled=yes list=WHATSAPP
add address=169.45.210.64/27 disabled=yes list=WHATSAPP
add address=169.45.214.224/27 disabled=yes list=WHATSAPP
add address=169.45.219.224/27 disabled=yes list=WHATSAPP
add address=169.45.237.192/27 disabled=yes list=WHATSAPP
add address=169.45.238.32/27 disabled=yes list=WHATSAPP
add address=169.45.248.96/27 disabled=yes list=WHATSAPP
add address=169.45.248.160/27 disabled=yes list=WHATSAPP
add address=169.46.52.224/27 disabled=yes list=WHATSAPP
add address=169.47.5.192/26 disabled=yes list=WHATSAPP
add address=169.47.6.64/27 disabled=yes list=WHATSAPP
add address=169.47.33.128/27 disabled=yes list=WHATSAPP
add address=169.47.35.32/27 disabled=yes list=WHATSAPP
add address=169.47.40.128/27 disabled=yes list=WHATSAPP
add address=169.47.42.96/27 disabled=yes list=WHATSAPP
add address=169.47.42.160/27 disabled=yes list=WHATSAPP
add address=169.47.42.192/26 disabled=yes list=WHATSAPP
add address=169.53.29.128/27 disabled=yes list=WHATSAPP
add address=169.53.48.32/27 disabled=yes list=WHATSAPP
add address=169.53.71.224/27 disabled=yes list=WHATSAPP
add address=169.53.81.64/27 disabled=yes list=WHATSAPP
add address=169.53.250.128/26 disabled=yes list=WHATSAPP
add address=169.53.252.64/27 disabled=yes list=WHATSAPP
add address=169.53.255.64/27 disabled=yes list=WHATSAPP
add address=169.54.2.160/27 disabled=yes list=WHATSAPP
add address=169.54.44.224/27 disabled=yes list=WHATSAPP
add address=169.54.51.32/27 disabled=yes list=WHATSAPP
add address=169.54.55.192/27 disabled=yes list=WHATSAPP
add address=169.54.193.160/27 disabled=yes list=WHATSAPP
add address=169.54.210.0/27 disabled=yes list=WHATSAPP
add address=169.54.222.128/27 disabled=yes list=WHATSAPP
add address=169.55.67.224/27 disabled=yes list=WHATSAPP
add address=169.55.69.128/26 disabled=yes list=WHATSAPP
add address=169.55.74.32/27 disabled=yes list=WHATSAPP
add address=169.55.75.96/27 disabled=yes list=WHATSAPP
add address=169.55.126.64/26 disabled=yes list=WHATSAPP
add address=169.55.210.96/27 disabled=yes list=WHATSAPP
add address=169.55.235.160/27 disabled=yes list=WHATSAPP
add address=173.192.162.32/27 disabled=yes list=WHATSAPP
add address=173.192.219.128/27 disabled=yes list=WHATSAPP
add address=173.192.222.160/27 disabled=yes list=WHATSAPP
add address=173.192.231.32/27 disabled=yes list=WHATSAPP
add address=173.193.205.0/27 disabled=yes list=WHATSAPP
add address=173.193.230.96/27 disabled=yes list=WHATSAPP
add address=173.193.230.128/27 disabled=yes list=WHATSAPP
add address=173.193.230.192/27 disabled=yes list=WHATSAPP
add address=173.193.239.0/27 disabled=yes list=WHATSAPP
add address=174.36.208.128/27 disabled=yes list=WHATSAPP
add address=174.36.210.32/27 disabled=yes list=WHATSAPP
add address=174.36.251.192/27 disabled=yes list=WHATSAPP
add address=174.37.199.192/27 disabled=yes list=WHATSAPP
add address=174.37.217.64/27 disabled=yes list=WHATSAPP
add address=174.37.243.64/27 disabled=yes list=WHATSAPP
add address=174.37.251.0/27 disabled=yes list=WHATSAPP
add address=179.60.192.51 disabled=yes list=WHATSAPP
add address=179.60.193.51 disabled=yes list=WHATSAPP
add address=179.60.195.51 disabled=yes list=WHATSAPP
add address=184.173.136.64/27 disabled=yes list=WHATSAPP
add address=184.173.147.32/27 disabled=yes list=WHATSAPP
add address=184.173.161.64 disabled=yes list=WHATSAPP
add address=184.173.161.160/27 disabled=yes list=WHATSAPP
add address=184.173.173.116 disabled=yes list=WHATSAPP
add address=184.173.179.32/27 disabled=yes list=WHATSAPP
add address=185.60.216.53 disabled=yes list=WHATSAPP
add address=185.60.218.53 disabled=yes list=WHATSAPP
add address=192.155.212.192/27 disabled=yes list=WHATSAPP
add address=198.11.193.182/31 disabled=yes list=WHATSAPP
add address=198.11.251.32/27 disabled=yes list=WHATSAPP
add address=198.23.80.0/27 disabled=yes list=WHATSAPP
add address=208.43.115.192/27 disabled=yes list=WHATSAPP
add address=208.43.117.79 disabled=yes list=WHATSAPP
add address=208.43.122.128/27 disabled=yes list=WHATSAPP
add address=157.240.11.54 disabled=yes list=WHATSAPP
add address=157.240.7.53 disabled=yes list=WHATSAPP
add address=202.70.54.98 disabled=yes list=WHATSAPP
add address=103.234.121.224 disabled=yes list=WHATSAPP
add address=157.240.13.54 disabled=yes list=WHATSAPP
add address=114.5.10.162 disabled=yes list=WHATSAPP
add address=114.4.163.226 disabled=yes list=WHATSAPP
add address=114.4.161.34 disabled=yes list=WHATSAPP
add address=114.5.10.224 disabled=yes list=WHATSAPP
add address=31.13.70.50 disabled=yes list=WHATSAPP
add address=157.240.14.53 disabled=yes list=WHATSAPP
add address=31.13.93.54 disabled=yes list=WHATSAPP
add address=114.4.23.225 disabled=yes list=WHATSAPP
add address=114.4.169.34 disabled=yes list=WHATSAPP
add address=157.240.22.54 disabled=yes list=WHATSAPP
add address=157.240.2.54 disabled=yes list=WHATSAPP
add address=34.192.181.12 disabled=yes list=WHATSAPP
add address=31.13.71.50 disabled=yes list=WHATSAPP
add address=114.121.226.97 disabled=yes list=WHATSAPP
add address=69.171.250.61 list=WHATSAPP
add address=157.240.19.54 list=WHATSAPP
add address=34.193.38.112 list=WHATSAPP
add address=157.240.3.55 list=WHATSAPP
add address=34.192.181.12 list=WHATSAPP
add address=31.13.65.50 list=WHATSAPP
add address=31.13.67.53 list=WHATSAPP
add address=31.13.71.50 list=WHATSAPP
add address=157.240.18.53 list=WHATSAPP
add address=157.240.2.54 list=WHATSAPP
add address=157.240.11.54 list=WHATSAPP
add address=36.91.202.34 list=WHATSAPP
add address=157.240.14.53 list=WHATSAPP
add address=31.13.70.50 list=WHATSAPP
add address=31.13.66.51 list=WHATSAPP
add address=34.194.71.217 list=WHATSAPP
add address=36.91.202.98 list=WHATSAPP
add address=157.240.218.60 list=WHATSAPP
add address=69.171.250.60 list=WHATSAPP
add address=112.215.156.226 list=WHATSAPP
add address=157.240.7.54 list=WHATSAPP
add address=157.240.13.54 list=WHATSAPP
add address=112.215.156.97 list=WHATSAPP
add address=31.13.93.54 list=WHATSAPP
add address=157.240.217.60 list=WHATSAPP
add address=157.240.218.61 list=WHATSAPP
add address=157.240.22.54 list=WHATSAPP
add address=34.194.255.230 list=WHATSAPP
add address=157.240.199.60 list=WHATSAPP
add address=157.240.0.61 list=WHATSAPP
add address=31.13.88.61 list=WHATSAPP
add address=112.215.156.162 list=WHATSAPP
add address=112.215.156.33 list=WHATSAPP
add address=223.255.225.33 list=WHATSAPP
add address=157.240.217.61 list=WHATSAPP
add address=192.168.2.0/24 list=private-lokal
add address=ical.webiot.id comment=webiot list=webiot
add address=202.70.54.98 list=WHATSAPP
add address=157.240.208.60 list=WHATSAPP
add address=103.234.121.224 list=WHATSAPP
add address=157.240.13.55 list=WHATSAPP
add address=157.240.10.53 list=WHATSAPP
add address=157.240.208.61 list=WHATSAPP
add address=157.240.10.54 list=WHATSAPP
add address=179.60.194.53 list=WHATSAPP
add address=117.103.116.117 list=WHATSAPP
/ip firewall filter
add action=accept chain=input comment=modem dst-port=\
    21,22,23,80,443,8291,65533 in-interface=bridge1 protocol=tcp src-address=\
    192.168.31.248/29
add action=accept chain=forward layer7-protocol=webiot protocol=tcp \
    src-address-list=blackIP
add action=drop chain=forward comment=blackIP protocol=tcp src-address-list=\
    blackIP
add action=drop chain=forward comment=blockYoutube layer7-protocol=Youtube \
    src-address-list=blackIP
add action=passthrough chain=unused-hs-chain comment=\
    "place hotspot rules here" disabled=yes
add action=drop chain=input comment="drop ssh brute forcers" dst-port=22 \
    protocol=tcp src-address-list=ssh_blacklist
add action=add-src-to-address-list address-list=ssh_blacklist \
    address-list-timeout=1w3d chain=input connection-state=new dst-port=22 \
    protocol=tcp src-address-list=ssh_stage3
add action=add-src-to-address-list address-list=ssh_stage3 \
    address-list-timeout=1m chain=input connection-state=new dst-port=22 \
    protocol=tcp src-address-list=ssh_stage2
add action=add-src-to-address-list address-list=ssh_stage2 \
    address-list-timeout=1m chain=input connection-state=new dst-port=22 \
    protocol=tcp src-address-list=ssh_stage1
add action=add-src-to-address-list address-list=ssh_stage1 \
    address-list-timeout=1m chain=input connection-state=new dst-port=22 \
    protocol=tcp
add action=drop chain=input comment="drop telnet brute forcers" dst-port=23 \
    protocol=tcp src-address-list=telnet_blacklist
add action=add-src-to-address-list address-list=telnet_blacklist \
    address-list-timeout=1w3d chain=input connection-state=new dst-port=23 \
    protocol=tcp src-address-list=telnet_stage3
add action=add-src-to-address-list address-list=telnet_stage3 \
    address-list-timeout=1m chain=input connection-state=new dst-port=23 \
    protocol=tcp src-address-list=telnet_stage2
add action=add-src-to-address-list address-list=telnet_stage2 \
    address-list-timeout=1m chain=input connection-state=new dst-port=23 \
    protocol=tcp src-address-list=telnet_stage1
add action=add-src-to-address-list address-list=telnet_stage1 \
    address-list-timeout=1m chain=input connection-state=new dst-port=23 \
    protocol=tcp
add action=drop chain=input comment="drop ftp brute forcers" dst-port=21 \
    protocol=tcp src-address-list=ftp_blacklist
add action=accept chain=output content="530 Login incorrect" dst-limit=\
    1/1m,9,dst-address/1m protocol=tcp
add action=add-dst-to-address-list address-list=ftp_blacklist \
    address-list-timeout=3h chain=output content="530 Login incorrect" \
    protocol=tcp
add action=drop chain=input comment="drop winbox brute forcers" dst-port=8291 \
    protocol=tcp src-address-list=winbox_blacklist
add action=add-src-to-address-list address-list=winbox_blacklist \
    address-list-timeout=1w3d chain=input connection-state=new dst-port=8291 \
    protocol=tcp src-address-list=winbox_stage3
add action=add-src-to-address-list address-list=winbox_stage3 \
    address-list-timeout=1m chain=input connection-state=new dst-port=8291 \
    protocol=tcp src-address-list=winbox_stage2
add action=add-src-to-address-list address-list=winbox_stage2 \
    address-list-timeout=1m chain=input connection-state=new dst-port=8291 \
    protocol=tcp src-address-list=winbox_stage1
add action=add-src-to-address-list address-list=winbox_stage1 \
    address-list-timeout=1m chain=input connection-state=new dst-port=8291 \
    protocol=tcp
add action=jump chain=forward comment=ddos connection-state=new jump-target=\
    detect-ddos
add action=return chain=detect-ddos dst-limit=32,32,src-and-dst-addresses/10s
add action=return chain=detect-ddos src-address=10.10.10.1
add action=add-dst-to-address-list address-list=ddosed address-list-timeout=\
    10m chain=detect-ddos
add action=add-src-to-address-list address-list=ddoser address-list-timeout=\
    10m chain=detect-ddos
add action=drop chain=forward connection-state=new dst-address-list=ddosed \
    log=yes log-prefix=DDoS src-address-list=ddoser
add action=drop chain=input dst-port=21,22,80,443,65533 in-interface=bridge1 \
    protocol=tcp
/ip firewall mangle
add action=mark-connection chain=prerouting comment=iCAL new-connection-mark=\
    iCAL passthrough=yes src-mac-address=CC:9F:7A:CE:AE:4A
add action=mark-packet chain=prerouting connection-mark=iCAL new-packet-mark=\
    iCAL passthrough=no
add action=mark-connection chain=prerouting comment="Black IP" \
    new-connection-mark=black passthrough=yes src-mac-address=\
    50:8F:4C:F4:63:34
add action=mark-packet chain=prerouting connection-mark=black \
    new-packet-mark=black passthrough=no
add action=mark-connection chain=prerouting comment=Toko new-connection-mark=\
    Toko passthrough=yes src-mac-address=28:D1:27:1B:27:7C
add action=mark-packet chain=prerouting connection-mark=Toko new-packet-mark=\
    Toko passthrough=no
add action=mark-connection chain=prerouting comment=Kontrakan \
    new-connection-mark=Kontrakan passthrough=yes src-mac-address=\
    9C:6F:52:DB:7D:07
add action=mark-packet chain=prerouting connection-mark=Kontrakan \
    new-packet-mark=Kontrakan passthrough=no
/ip firewall nat
add action=passthrough chain=unused-hs-chain comment=\
    "place hotspot rules here" disabled=yes
add action=masquerade chain=srcnat out-interface=ether1
add action=dst-nat chain=dstnat dst-address=192.168.1.1 dst-port=80 protocol=\
    tcp to-addresses=192.168.1.3 to-ports=0-65532
add action=masquerade chain=srcnat disabled=yes out-interface=bridge1
add action=redirect chain=dstnat dst-address-list=private-lokal dst-port=\
    80,443 protocol=tcp to-ports=8080
add action=masquerade chain=srcnat out-interface=ether2
/ip firewall raw
add action=add-dst-to-address-list address-list=WHATSAPP \
    address-list-timeout=none-static chain=prerouting comment=WA content=\
    .whatsapp dst-address-list=!private-lokal src-address-list=private-lokal
add action=drop chain=prerouting comment=blackIP src-address-list=blackIP \
    time=0s-6h,sun,mon,tue,wed,thu,fri,sat
# inactive time
add action=drop chain=prerouting src-address-list=blackIP time=\
    6h30m-11h30m,sun,mon,tue,wed,thu,fri,sat
# inactive time
add action=drop chain=prerouting src-address-list=blackIP time=\
    12h-17h30m,sun,mon,tue,wed,thu,fri,sat
# inactive time
add action=drop chain=prerouting src-address-list=blackIP time=\
    18h-1d,sun,mon,tue,wed,thu,fri,sat
/ip hotspot ip-binding
add mac-address=B8:27:EB:15:41:5D to-address=192.168.31.248 type=bypassed
add mac-address=CC:9F:7A:CE:AE:4A to-address=192.168.31.252 type=bypassed
add mac-address=00:0A:00:78:6E:28 to-address=192.168.31.250 type=bypassed
add address=192.168.31.249 disabled=yes mac-address=8E:53:C3:07:93:8B \
    to-address=192.168.31.249 type=bypassed
add mac-address=28:D1:27:1B:27:7C to-address=192.168.31.254 type=bypassed
add mac-address=9C:6F:52:DB:7D:07 to-address=192.168.31.1 type=bypassed
/ip hotspot user
add comment=Admin disabled=yes limit-bytes-in=30000000000 limit-bytes-out=\
    30000000000 limit-bytes-total=30000000000 name=admin password=10041987nm \
    profile=user10
/ip hotspot walled-garden
add comment="place hotspot rules here" disabled=yes
add comment=Whatsapp dst-host=*whatsapp.com dst-port=443
add dst-host=*whatsapp.net dst-port=443
add dst-host=wa.me dst-port=443
/ip hotspot walled-garden ip
add action=accept comment=whatsapp disabled=yes !dst-address \
    dst-address-list=WHATSAPP !dst-port !protocol !src-address \
    !src-address-list
add action=drop disabled=no !dst-address !dst-address-list dst-host=\
    *.youtube.com !dst-port protocol=tcp !src-address !src-address-list
/ip proxy
set cache-administrator=admin@webiot.id enabled=yes
/ip proxy access
add dst-address=192.168.1.0/24 src-address=192.168.31.248/29
add dst-address=192.168.31.0/24 src-address=192.168.31.248/29
add action=deny dst-address=192.168.1.0/24 dst-port=\
    20,21,22,23,80,443,8291,65533 redirect-to=webiot.id
add action=deny dst-address=192.168.31.254 dst-port=80,443 redirect-to=\
    webiot.id
add action=deny dst-address=192.168.31.1 dst-port=80,443 redirect-to=\
    webiot.id
add action=deny dst-address=192.168.2.1 dst-port=\
    20,21,22,23,80,443,8291,65533 redirect-to=webiot.id
add action=deny dst-address=192.168.2.2 dst-port=\
    20,21,22,23,80,443,8291,65533 redirect-to=webiot.id
/ip route
add distance=1 gateway=192.168.1.1
/ip service
set www port=65533
/radius
add address=127.0.0.1 secret=10041987nm service=hotspot
add address=192.168.31.2 secret=10041987nm service=hotspot
add address=192.168.2.1 secret=10041987nm service=hotspot
/system clock
set time-zone-name=Asia/Jakarta
/system clock manual
set time-zone=+07:00
/system gps
set set-system-time=yes
/system identity
set name=iCAL-hotspot
/system lcd
set contrast=0 enabled=no port=parallel type=24x4
/system lcd page
set time disabled=yes display-time=5s
set resources disabled=yes display-time=5s
set uptime disabled=yes display-time=5s
set packets disabled=yes display-time=5s
set bits disabled=yes display-time=5s
set version disabled=yes display-time=5s
set identity disabled=yes display-time=5s
set bridge1 disabled=yes display-time=5s
set ether1 disabled=yes display-time=5s
set ether2 disabled=yes display-time=5s
set ether3 disabled=yes display-time=5s
set ether4 disabled=yes display-time=5s
set ether5 disabled=yes display-time=5s
/system logging
add action=disk prefix=-> topics=hotspot,info,debug
/system ntp client
set enabled=yes primary-ntp=202.65.114.202 secondary-ntp=202.162.32.12
/system scheduler
add interval=5m name=removeSession on-event=removeSession policy=\
    ftp,reboot,read,write,policy,test,password,sniff,sensitive start-time=\
    startup
add comment="aug/02/2020 13:45:37" interval=30s name=logMikrotik on-event=\
    "/system script run logMikrotik" policy=\
    ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon \
    start-time=startup
add interval=5s name=Telegram on-event="/system script run tg_getUpdates" \
    policy=ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon \
    start-time=startup
add interval=1h name=logHost on-event="/system script run tg_cmd_host" \
    policy=ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon \
    start-time=startup
/system script
add dont-require-permissions=no name=removeSession owner=admin policy=\
    ftp,reboot,read,write,policy,test,password,sniff,sensitive source="# Scrip\
    t Source : Mikrotik Forums\r\
    \n# Script Starts Here.\r\
    \n# Setting Timeout in Seconds\r\
    \n# Timeout in Seconds, when session update is older -> session closed\r\
    \n:local Timeout 60\r\
    \n \r\
    \n#------------------------------------------\r\
    \n:local LastSessionUpdate;\r\
    \n:local SessionTimeout;\r\
    \n:foreach i in=[/tool user-manager session find where active=yes] do={\r\
    \n \r\
    \n# When was the last Update of the session-informations\r\
    \n:set LastSessionUpdate [/tool user-manager session get \$i till-time]\r\
    \n \r\
    \n# SessionTimeout is a value that tells me how many seconds ago the last \
    update of this session was\r\
    \n:set SessionTimeout ([system clock get time] - [:pick \$LastSessionUpdat\
    e ([:find \$LastSessionUpdate \" \"]+1) [:len \$LastSessionUpdate]]-[/syst\
    em clock get gmt-offset])\r\
    \n \r\
    \n# if last update is more then Timeout seconds ago then close session and\
    \_log it\r\
    \n:if (\$SessionTimeout > \$Timeout) do={\r\
    \n/tool user-manager session remove  numbers=\$i\r\
    \n:log warning (\" Removed false active session Username is  \" . [/tool u\
    ser-manager session get \$i user]);\r\
    \n}\r\
    \n}"
add dont-require-permissions=no name=tg_config owner=admin policy=read \
    source=":put \"tg: Load config\"\r\
    \n\r\
    \n:local config {\r\
    \n\r\
    \n\"botAPI\"=\"1391417232:AAGBb6wRz6nfzpP1F2NoDlceC_FkCwVNe5A\";\r\
    \n\"defaultChatID\"=\"1299622755\";\r\
    \n\"trusted\"=\"1299622755,752105464\";\r\
    \n\"storage\"=\"\";\r\
    \n\"timeout\"=1;\r\
    \n}\r\
    \n\r\
    \nreturn \$config"
add dont-require-permissions=no name=tg_getUpdates owner=admin policy=read \
    source=":global TGLASTMSGID\r\
    \n:global TGLASTUPDID\r\
    \n\r\
    \n:local fconfig [:parse [/system script get tg_config source]]\r\
    \n:local http [:parse [/system script get func_fetch source]]\r\
    \n:local gkey [:parse [/system script get tg_getkey source]]\r\
    \n:local send [:parse [/system script get tg_sendMessage source]]\r\
    \n\r\
    \n:local cfg [\$fconfig]\r\
    \n:local trusted [:toarray (\$cfg->\"trusted\")]\r\
    \n:local botID (\$cfg->\"botAPI\")\r\
    \n:local storage (\$cfg->\"storage\")\r\
    \n:local timeout (\$cfg->\"timeout\")\r\
    \n\r\
    \n:put \"cfg=\$cfg\"\r\
    \n:put \"trusted=\$trusted\"\r\
    \n:put \"botID=\$botID\"\r\
    \n:put \"storage=\$storage\"\r\
    \n:put \"timeout=\$timeout\"\r\
    \n\r\
    \n:local file (\$storage.\"tg_get_updates.txt\")\r\
    \n:local logfile (\$storage.\"tg_fetch_log.txt\")\r\
    \n#get 1 message per time\r\
    \n:local url (\"https://api.telegram.org/bot\".\$botID.\"/getUpdates\?time\
    out=\$timeout&limit=1\")\r\
    \n:if ([:len \$TGLASTUPDID]>0) do={\r\
    \n  :set url \"\$url&offset=\$(\$TGLASTUPDID+1)\"\r\
    \n}\r\
    \n\r\
    \n:put \"Reading updates...\"\r\
    \n:local res [\$http dst-path=\$file url=\$url resfile=\$logfile]\r\
    \n:if (\$res!=\"success\") do={\r\
    \n  :put \"Error getting updates\"\r\
    \n  return \"Failed get updates\"\r\
    \n}\r\
    \n:put \"Finished to read updates.\"\r\
    \n\r\
    \n:local content [/file get [/file find name=\$file] contents]\r\
    \n\r\
    \n:local msgid [\$gkey key=\"message_id\" text=\$content]\r\
    \n:if (\$msgid=\"\") do={ \r\
    \n :put \"No new updates\"\r\
    \n :return 0 \r\
    \n}\r\
    \n:set TGLASTMSGID \$msgid\r\
    \n\r\
    \n:local updid [\$gkey key=\"update_id\" text=\$content]\r\
    \n:set TGLASTUPDID \$updid\r\
    \n\r\
    \n:local fromid [\$gkey block=\"from\" key=\"id\" text=\$content]\r\
    \n:local username [\$gkey block=\"from\" key=\"username\" text=\$content]\
    \r\
    \n:local firstname [\$gkey block=\"from\" key=\"first_name\" text=\$conten\
    t]\r\
    \n:local lastname [\$gkey block=\"from\" key=\"last_name\" text=\$content]\
    \r\
    \n:local chatid [\$gkey block=\"chat\" key=\"id\" text=\$content]\r\
    \n:local chattext [\$gkey block=\"chat\" key=\"text\" text=\$content]\r\
    \n\r\
    \n:put \"message id=\$msgid\"\r\
    \n:put \"update id=\$updid\"\r\
    \n:put \"from id=\$fromid\"\r\
    \n:put \"first name=\$firstname\"\r\
    \n:put \"last name=\$lastname\"\r\
    \n:put \"username=\$username\"\r\
    \n:local name \"\$firstname \$lastname\"\r\
    \n:if ([:len \$name]<2) do {\r\
    \n :set name \$username\r\
    \n}\r\
    \n\r\
    \n:put \"in chat=\$chatid\"\r\
    \n:put \"command=\$chattext\"\r\
    \n\r\
    \n:local allowed ( [:type [:find \$trusted \$fromid]]!=\"nil\" or [:type [\
    :find \$trusted \$chatid]]!=\"nil\")\r\
    \n:if (!\$allowed) do={\r\
    \n :put \"Unknown sender, keep silence\"\r\
    \n :return -1\r\
    \n}\r\
    \n\r\
    \n:local cmd \"\"\r\
    \n:local params \"\"\r\
    \n:local ltext [:len \$chattext]\r\
    \n\r\
    \n:local pos [:find \$chattext \" \"]\r\
    \n:if ([:type \$pos]=\"nil\") do={\r\
    \n :set cmd [:pick \$chattext 1 \$ltext]\r\
    \n} else={\r\
    \n :set cmd [:pick \$chattext 1 \$pos]\r\
    \n :set params [:pick \$chattext (\$pos+1) \$ltext]\r\
    \n}\r\
    \n\r\
    \n:local pos [:find \$cmd \"@\"]\r\
    \n:if ([:type \$pos]!=\"nil\") do={\r\
    \n :set cmd [:pick \$cmd 0 \$pos]\r\
    \n}\r\
    \n\r\
    \n:put \"cmd=<\$cmd>\"\r\
    \n:put \"params=<\$params>\"\r\
    \n\r\
    \n:global TGLASTCMD \$cmd\r\
    \n\r\
    \n:put \"Try to invoke external script tg_cmd_\$cmd\"\r\
    \n:local script [:parse [/system script get \"tg_cmd_\$cmd\" source]]\r\
    \n\$script params=\$params chatid=\$chatid from=\$name"
add dont-require-permissions=no name=func_fetch owner=admin policy=\
    ftp,read,write,policy,test source="#######################################\
    ##################\r\
    \n# Wrapper for /tools fetch\r\
    \n#  Input:\r\
    \n#    mode\r\
    \n#    upload=yes/no\r\
    \n#    user\r\
    \n#    password\r\
    \n#    address\r\
    \n#    host\r\
    \n#    httpdata\r\
    \n#    httpmethod\r\
    \n#    check-certificate\r\
    \n#    src-path\r\
    \n#    dst-path\r\
    \n#    ascii=yes/no\r\
    \n#    url\r\
    \n#    resfile\r\
    \n\r\
    \n:local res \"fetchresult.txt\"\r\
    \n:if ([:len \$resfile]>0) do={:set res \$resfile}\r\
    \n#:put \$res\r\
    \n\r\
    \n:local cmd \"/tool fetch\"\r\
    \n:if ([:len \$mode]>0) do={:set cmd \"\$cmd mode=\$mode\"}\r\
    \n:if ([:len \$upload]>0) do={:set cmd \"\$cmd upload=\$upload\"}\r\
    \n:if ([:len \$user]>0) do={:set cmd \"\$cmd user=\\\"\$user\\\"\"}\r\
    \n:if ([:len \$password]>0) do={:set cmd \"\$cmd password=\\\"\$password\\\
    \"\"}\r\
    \n:if ([:len \$address]>0) do={:set cmd \"\$cmd address=\\\"\$address\\\"\
    \"}\r\
    \n:if ([:len \$host]>0) do={:set cmd \"\$cmd host=\\\"\$host\\\"\"}\r\
    \n:if ([:len \$\"http-data\"]>0) do={:set cmd \"\$cmd http-data=\\\"\$\"ht\
    tp-data\"\\\"\"}\r\
    \n:if ([:len \$\"http-method\"]>0) do={:set cmd \"\$cmd http-method=\\\"\$\
    \"http-method\"\\\"\"}\r\
    \n:if ([:len \$\"check-certificate\"]>0) do={:set cmd \"\$cmd check-certif\
    icate=\\\"\$\"check-certificate\"\\\"\"}\r\
    \n:if ([:len \$\"src-path\"]>0) do={:set cmd \"\$cmd src-path=\\\"\$\"src-\
    path\"\\\"\"}\r\
    \n:if ([:len \$\"dst-path\"]>0) do={:set cmd \"\$cmd dst-path=\\\"\$\"dst-\
    path\"\\\"\"}\r\
    \n:if ([:len \$ascii]>0) do={:set cmd \"\$cmd ascii=\\\"\$ascii\\\"\"}\r\
    \n:if ([:len \$url]>0) do={:set cmd \"\$cmd url=\\\"\$url\\\"\"}\r\
    \n\r\
    \n:put \">> \$cmd\"\r\
    \n\r\
    \n:global FETCHRESULT\r\
    \n:set FETCHRESULT \"none\"\r\
    \n\r\
    \n:local script \"\\\r\
    \n :global FETCHRESULT;\\\r\
    \n :do {\\\r\
    \n   \$cmd;\\\r\
    \n   :set FETCHRESULT \\\"success\\\";\\\r\
    \n } on-error={\\\r\
    \n  :set FETCHRESULT \\\"failed\\\";\\\r\
    \n }\\\r\
    \n\"\r\
    \n:execute script=\$script file=\$res\r\
    \n:local cnt 0\r\
    \n#:put \"\$cnt -> \$FETCHRESULT\"\r\
    \n:while (\$cnt<100 and \$FETCHRESULT=\"none\") do={ \r\
    \n :delay 1s\r\
    \n :set \$cnt (\$cnt+1)\r\
    \n #:put \"\$cnt -> \$FETCHRESULT\"\r\
    \n}\r\
    \n:local content [/file get [find name=\$res] content]\r\
    \n#:put \$content\r\
    \nif (\$content~\"finished\") do={:return \"success\"}\r\
    \n:return \$FETCHRESULT"
add dont-require-permissions=no name=tg_getkey owner=admin policy=read \
    source=":local cur 0\r\
    \n:local lkey [:len \$key]\r\
    \n:local res \"\"\r\
    \n:local p\r\
    \n\r\
    \n:if ([:len \$block]>0) do={\r\
    \n :set p [:find \$text \$block \$cur]\r\
    \n :if ([:type \$p]=\"nil\") do={\r\
    \n  :return \$res\r\
    \n }\r\
    \n :set cur (\$p+[:len \$block]+2)\r\
    \n}\r\
    \n\r\
    \n:set p [:find \$text \$key \$cur]\r\
    \n:if ([:type \$p]!=\"nil\") do={\r\
    \n :set cur (\$p+lkey+2)\r\
    \n :set p [:find \$text \",\" \$cur]\r\
    \n :if ([:type \$p]!=\"nil\") do={\r\
    \n   if ([:pick \$text \$cur]=\"\\\"\") do={\r\
    \n    :set res [:pick \$text (\$cur+1) (\$p-1)]\r\
    \n   } else={\r\
    \n    :set res [:pick \$text \$cur \$p]\r\
    \n   }\r\
    \n } \r\
    \n}\r\
    \n:return \$res"
add dont-require-permissions=no name=tg_sendMessage owner=admin policy=read \
    source=":local fconfig [:parse [/system script get tg_config source]]\r\
    \n\r\
    \n:local cfg [\$fconfig]\r\
    \n:local chatID (\$cfg->\"defaultChatID\")\r\
    \n:local botID (\$cfg->\"botAPI\")\r\
    \n:local storage (\$cfg->\"storage\")\r\
    \n\r\
    \n:if ([:len \$chat]>0) do={:set chatID \$chat}\r\
    \n\r\
    \n:local url \"https://api.telegram.org/bot\$botID/sendmessage\?chat_id=\$\
    chatID&text=\$text\"\r\
    \n:if ([:len \$mode]>0) do={:set url (\$url.\"&parse_mode=\$mode\")}\r\
    \n\r\
    \n:local file (\$tgStorage.\"tg_get_updates.txt\")\r\
    \n:local logfile (\$tgStorage.\"tg_fetch_log.txt\")\r\
    \n\r\
    \n/tool fetch url=\$url keep-result=no"
add dont-require-permissions=no name=tg_cmd_cpu owner=admin policy=read \
    source=":local send [:parse [/system script get tg_sendMessage source]]\r\
    \n:local hotspot [:len [/ip hotspot active find]]\r\
    \n\r\
    \n:put \$params\r\
    \n:put \$chatid\r\
    \n:put \$from\r\
    \n \r\
    \n:local text \"Router Id:* \$[/system identity get name] * %0A\\\r\
    \nUptime: _\$[/system resource get uptime]_%0A\\\r\
    \nCPU Load: _\$[/system resource get cpu-load]%_%0A \\\r\
    \nRAM: _\$(([/system resource get total-memory]-[/system resource get free\
    -memory])/(1024*1024))M/\$([/system resource get total-memory]/(1024*1024)\
    )M_%0A\\\r\
    \nVoltage: _\$[:pick [/system health get voltage] 0 2]V_%0A\\\r\
    \nTemp: _\$[ /system health get temperature]C_\"\r\
    \n \r\
    \n\$send chat=\$chatid text=\$text mode=\"Markdown\"\r\
    \n:return true"
add dont-require-permissions=no name=tg_cmd_hi owner=admin policy=read \
    source=":local send [:parse [/system script get tg_sendMessage source]]\r\
    \n\r\
    \n:put \$params\r\
    \n:put \$chatid\r\
    \n:put \$from\r\
    \n\r\
    \n:local text \"Router Id:* \$[/system identity get name] * %0A\\\r\
    \n==================%0A\\\r\
    \nPerintah%0A\\\r\
    \n==================%0A\\\r\
    \n/u%0A\\\r\
    \n/dhcp%0A\\\r\
    \n/cpu%0A\\\r\
    \n/hotspot%0A\\\r\
    \n/ping%0A\\\r\
    \n/public%0A\\\r\
    \n/PoeAdd%0A\\\r\
    \n/dialing%0A\\\r\
    \n/eHotspot%0A\\\r\
    \n/dHotspot%0A\\\r\
    \n/force%0A\\\r\
    \n/reboot\"\r\
    \n \r\
    \n\$send chat=\$chatid text=\$text mode=\"Markdown\"\r\
    \n:return true"
add dont-require-permissions=no name=tg_cmd_hotspot owner=admin policy=read \
    source=":local send [:parse [/system script get tg_sendMessage source]]\r\
    \n:local param1 [:pick \$params 0 [:find \$params \" \"]]\r\
    \n:local param2 [:pick \$params ([:find \$params \" \"]+1) [:len \$params]\
    ]\r\
    \n:local param3 [:pick [:pick \$params ([:find \$params \" \"]+1) [:len \$\
    params]] ([:find [:pick \$params ([:find \$params \" \"]+1) [:len \$params\
    ]] \" \"]+1) [:len [:pick \$params ([:find \$params \" \"]+1) [:len \$para\
    ms]]]]\r\
    \n:if ([:len [:find \$param2 \" \"]]>0) do={\r\
    \n\t:set param2 [:pick [:pick \$params ([:find \$params \" \"]+1) [:len \$\
    params]] 0 [:find [:pick \$params ([:find \$params \" \"]+1) [:len \$param\
    s]] \" \"]]\r\
    \n} else={\r\
    \n\t:set param3 \"\"\r\
    \n}\r\
    \n\r\
    \n:put \$params\r\
    \n:put \$param1\r\
    \n:put \$param2\r\
    \n:put \$param3\r\
    \n:put \$chatid\r\
    \n:put \$from\r\
    \n\r\
    \n:if (\$param1=\"add\") do={\r\
    \n/ip hotspot user add name=\$param2 password=\$param3 profile=default \r\
    \n\$send chat=\$chatid text=(\"Username: \$param2 Password: \$param3 Berha\
    sil dibuat...\") mode=\"Markdown\"\r\
    \n}\r\
    \n:if (\$param1=\"delete\") do={\r\
    \n/ip hotspot user remove [find name=\$param2]\r\
    \n\$send chat=\$chatid text=(\"User: \$param2 Berhasil dihapus\") mode=\"M\
    arkdown\"\r\
    \n}\r\
    \n:if (\$param1=\"disable\") do={\r\
    \n/ip hotspot user disable [find name=\$param2]\r\
    \n\$send chat=\$chatid text=(\"User: \$param2 Berhasil di disable\") mode=\
    \"Markdown\"\r\
    \n}\r\
    \n:if (\$param1=\"enable\") do={\r\
    \n/ip hotspot user enable [find name=\$param2]\r\
    \n\$send chat=\$chatid text=(\"User: \$param2 Berhasil di enable\") mode=\
    \"Markdown\"\r\
    \n}\r\
    \n:if (\$param1=\"setprofil\") do={\r\
    \n/ip hotspot user set profile=\$param3 [find name=\$param2]\r\
    \n/ip hotspot active remove [find name=\$param2]\r\
    \n\$send chat=\$chatid text=(\"User: \$param2 Berhasil diganti profile men\
    jadi \$param3...\") mode=\"Markdown\"\r\
    \n}\r\
    \n:if (\$param1=\"pasword\") do={\r\
    \n/ip hotspot user set password=\$param3 [find name=\$param2]\r\
    \n/ip hotspot active remove [find name=\$param2]\r\
    \n\$send chat=\$chatid text=(\"User: \$param2 pasword diganti menjadi \$pa\
    ram3...\") mode=\"Markdown\"\r\
    \n}\r\
    \n:if (\$params=\"print\") do={\r\
    \n:local output\r\
    \n:foreach activeIndex in=[/ip hotspot active find] do={\r\
    \n:local activeUser (\"*Username:* \".[/ip hotspot active get value-name=\
    \"user\" \$activeIndex].\"%0A\")\r\
    \n:local activeAddress (\"*Address:* \".[/ip hotspot active get value-name\
    =\"address\" \$activeIndex].\"%0A\")\r\
    \n:local activeMACAddr (\"*MAC Address:* \".[/ip hotspot active get value-\
    name=\"mac-address\" \$activeIndex].\"%0A\")\r\
    \n:local activeLoginBy (\"*Login by:* \".[/ip hotspot active get value-nam\
    e=\"login-by\" \$activeIndex].\"%0A\")\r\
    \n:local activeUptime (\"*Uptime:* \".[/ip hotspot active get value-name=\
    \"uptime\" \$activeIndex].\"%0A\")\r\
    \n:set output (\$output.\$activeUser.\$activeAddress.\$activeMACAddr.\$act\
    iveUptime.\$activeLoginBy.\"%0A\")\r\
    \n}\r\
    \n\$send chat=\$chatid text=(\"\$output\") mode=\"Markdown\"\r\
    \n}\r\
    \n:if (\$param1=\"user\") do={\r\
    \n:local output\r\
    \n:foreach activeIndex in=[/ip hotspot user find profile=\$param2] do={\r\
    \n:local user (\"*Username:* \".[/ip hotspot user get value-name=\"name\" \
    \$activeIndex].\"%0A\")\r\
    \n:local password (\"*Password:* \".[/ip hotspot user get value-name=\"pas\
    sword\" \$activeIndex].\"%0A\")\r\
    \n:local uptime (\"*Uptime:* \".[/ip hotspot user get value-name=\"uptime\
    \" \$activeIndex].\"%0A\")\r\
    \n:set output (\$output.\$user.\$password.\$uptime.\"%0A\")\r\
    \n}\r\
    \n\$send chat=\$chatid text=(\"\$output\") mode=\"Markdown\"\r\
    \n}"
add dont-require-permissions=no name=tg_cmd_public owner=admin policy=read \
    source=":local public;\r\
    \n\
    \n:local status;\
    \n\r\
    \n:local ddns;\r\
    \n\
    \n:set public [/ip cloud get public-address];\r\
    \n\
    \n:set ddns [/ip cloud get dns-name];\r\
    \n\
    \n/tool fetch url=\"https://api.telegram.org/bot1391417232:AAGBb6wRz6nfzpP\
    1F2NoDlceC_FkCwVNe5A/sendMessage\?chat_id=1299622755&text=DDNS : \$ddns : \
    IP Public : \$public \" keep-result=no"
add dont-require-permissions=no name=tg_cmd_ping owner=admin policy=\
    ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon source=":\
    local send [:parse [/system script get tg_sendMessage source]]\r\
    \n:put \$params\r\
    \n:put \$chatid\r\
    \n:put \$from\r\
    \n#Ping Variables\r\
    \n:local avgRtt;\r\
    \n:local pin\r\
    \n:local pout\r\
    \n:local datetime \"\$[/system clock get date] \$[/system clock get time]\
    \"\r\
    \n#Ping it real good\r\
    \n/tool flood-ping 8.8.8.8 count=10 do={\r\
    \n  \r\
    \n:if (\$sent = 10) do={\r\
    \n    \r\
    \n:set avgRtt \$\"avg-rtt\"\r\
    \n    \r\
    \n:set pout \$sent\r\
    \n    \r\
    \n:set pin \$received\r\
    \n  }\r\
    \n\r\
    \n}\r\
    \n\r\
    \n:local ploss (100 - ((\$pin * 100) / \$pout))\r\
    \n\r\
    \n:local logmsg (\"Ping Average for 8.8.8.8 - \".[:tostr \$avgRtt].\"ms - \
    packet loss: \".[:tostr \$ploss].\"%\")\r\
    \n\r\
    \n:log info \$logmsg\r\
    \n\r\
    \n:local text \"Router Id:* \$[/system identity get name] * %0A\\\r\
    \nTanggal : _\$datetime_%0A\\\r\
    \nPing : _8.8.8.8_%0A\\\r\
    \nLog : _\$logmsg_\"\r\
    \n\$send chat=\$chatid text=\$text mode=\"Markdown\"\r\
    \n:return true"
add dont-require-permissions=no name=tg_cmd_dialing owner=admin policy=\
    read,write source="/tool fetch url=\"https://api.telegram.org/bot139141723\
    2:AAGBb6wRz6nfzpP1F2NoDlceC_FkCwVNe5A/sendMessage\?chat_id=1299622755&text\
    =Dialing....\" keep-result=no\r\
    \n:delay 1\r\
    \n/interface pppoe-client enable pppoe-indihome\r\
    \n:delay 5\r\
    \n/ip cloud force-update"
add dont-require-permissions=no name=tg_cmd_dHotspot owner=admin policy=\
    ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon source="/\
    ip hotspot disable hotspot\r\
    \n/tool fetch url=\"https://api.telegram.org/bot1391417232:AAGBb6wRz6nfzpP\
    1F2NoDlceC_FkCwVNe5A/sendMessage\?chat_id=1299622755&text=Hotspot Disable\
    \" keep-result=no"
add dont-require-permissions=no name=tg_cmd_eHotspot owner=admin policy=\
    ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon source="/\
    ip hotspot enable hotspot\r\
    \n/tool fetch url=\"https://api.telegram.org/bot1391417232:AAGBb6wRz6nfzpP\
    1F2NoDlceC_FkCwVNe5A/sendMessage\?chat_id=1299622755&text=Hotspot Enable\"\
    \_keep-result=no"
add dont-require-permissions=no name=tg_cmd_force owner=admin policy=\
    ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon source="/\
    ip cloud force-update\r\
    \n/tool fetch url=\"https://api.telegram.org/bot1391417232:AAGBb6wRz6nfzpP\
    1F2NoDlceC_FkCwVNe5A/sendMessage\?chat_id=1299622755&text=Force Update DDN\
    S\" keep-result=no"
add dont-require-permissions=no name=tg_cmd_PoeAdd owner=admin policy=\
    ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon source=":\
    local satu ([/interface pppoe-client monitor pppoe-indihome as-value]-> st\
    atus);\r\
    \n/tool fetch url=\"https://api.telegram.org/bot1391417232:AAGBb6wRz6nfzpP\
    1F2NoDlceC_FkCwVNe5A/sendMessage\?chat_id=1299622755&text=\$satu\" keep-re\
    sult=no\r\
    \n\r\
    \n\r\
    \n"
add dont-require-permissions=no name=hapusLogUserman owner=admin policy=\
    ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon source=":\
    foreach i in=[/tool user-manager session find] do={\
    \n\r\
    \n:log warning \"delete session user \$[/tool user-manager session get \$i\
    \_user]\"\
    \n\r\
    \n/tool user-manager session remove \$i\
    \n\r\
    \n}\r\
    \n\
    \n:log info \"====== delete log session user hotspot selesai!..=====\""
add dont-require-permissions=no name=tg_cmd_u owner=admin policy=read source="\
    :local send [:parse [/system script get tg_sendMessage source]]\r\
    \n:local param1 [:pick \$params 0 [:find \$params \" \"]]\r\
    \n:local param2 [:pick \$params ([:find \$params \" \"]+1) [:len \$params]\
    ]\r\
    \n:local param3 [:pick [:pick \$params ([:find \$params \" \"]+1) [:len \$\
    params]] ([:find [:pick \$params ([:find \$params \" \"]+1) [:len \$params\
    ]] \" \"]+1) [:len [:pick \$params ([:find \$params \" \"]+1) [:len \$para\
    ms]]]]\r\
    \n:if ([:len [:find \$param2 \" \"]]>0) do={\r\
    \n\t:set param2 [:pick [:pick \$params ([:find \$params \" \"]+1) [:len \$\
    params]] 0 [:find [:pick \$params ([:find \$params \" \"]+1) [:len \$param\
    s]] \" \"]]\r\
    \n} else={\r\
    \n\t:set param3 \"\"\r\
    \n}\r\
    \n\r\
    \n:put \$params\r\
    \n:put \$param1\r\
    \n:put \$param2\r\
    \n:put \$param3\r\
    \n:put \$chatid\r\
    \n:put \$from\r\
    \n\r\
    \n:local text \"Router Id:* \$[/system identity get name] * %0A\\\r\
    \n==================%0A\\\r\
    \nPerintah%0A\\\r\
    \n==================%0A\\\r\
    \n/u%0A\\\r\
    \n/u all%0A\\\r\
    \n/u nama pass paket%0A\\\r\
    \n/u ubah nama paket%0A\\\r\
    \n/u hapus nama%0A\\\r\
    \n/u logout nama || /u keluar IP%0A%0A\\\r\
    \nJenis paket:%0A\\\r\
    \n- Paket 500 MB%0A\\\r\
    \n- Paket 1 GB%0A\\\r\
    \n- Paket 1 jam%0A\\\r\
    \n- Paket 3 jam%0A\\\r\
    \n- Paket 5 jam%0A\\\r\
    \n- Paket 1 hari%0A\\\r\
    \n- Paket 1 Minggu%0A\\\r\
    \n- Paket 1 Bulan%0A\\\r\
    \n- Paket 1 Bulan min%0A\\\r\
    \n- Paket 1 Bulan max%0A\\\r\
    \n==================%0A\"\r\
    \n\$send chat=\$chatid text=(\"\$text\") mode=\"Markdown\"\r\
    \n\r\
    \n:local output\r\
    \n\r\
    \n:if (\$param1=\"hapus\") do={\r\
    \n\t:local username \"\$param2\"\r\
    \n\t/tool user-manager user remove numbers=\"\$username\";\r\
    \n\t/ip hotspot active remove [find user=\"\$username\"];\r\
    \n\t:set output (\"%0AUser: \$param2 %0ABerhasil dihapus\")\r\
    \n}\r\
    \n:if (\$param1=\"logout\") do={\r\
    \n\t:local username \"\$param2\";\r\
    \n\t:local activeKuota (\"Kuota: \".[((([/ip hotspot active get [find user\
    =\"\$param2\"] limit-bytes-in])-([/ip hotspot active get [find user=\"\$pa\
    ram2\"] bytes-in]))/1048576)].\" Mb / \".[((([/ip hotspot active get [find\
    \_user=\"\$param2\"] limit-bytes-out])-([/ip hotspot active get [find user\
    =\"\$param2\"] bytes-out]))/1048576)].\" Mb || \")\r\
    \n\t:local activeTime (\"Sisa waktu: \".[/ip hotspot active get [find user\
    =\"\$param2\"] session-time-left])\r\
    \n\t:set output (\"%0AUser: \$param2 || Berhasil logout secara paksa%0A\$a\
    ctiveKuota\$activeTime\")\r\
    \n\t/ip hotspot active remove [find user=\"\$username\"];\r\
    \n}\r\
    \n:if (\$param1=\"keluar\") do={\r\
    \n\t:local address \"\$param2\";\r\
    \n\t:local activeUser ([/ip hotspot active get value-name=\"user\" [find a\
    ddress=\"\$param2\"]])\r\
    \n\t:set output (\"%0AUser: \$activeUser || IP: \$param2 || Berhasil dikel\
    uarkan secara paksa%0A\$activeKuota\$activeTime\")\r\
    \n\t/ip hotspot active remove [find address=\"\$param2\"];\r\
    \n}\r\
    \n:if (\$params=\"all\") do={\r\
    \n\t:foreach activeIndex in=[/tool user-manager user find] do={\r\
    \n\t :local activeUser (\"- *Username:* \".[/tool user-manager user get va\
    lue-name=\"username\" \$activeIndex].\" || \")\r\
    \n\t :local activePaket (\"- *Paket:* \".[/tool user-manager user get valu\
    e-name=\"actual-profile\" \$activeIndex].\"%0A\")\r\
    \n\t :set output (\$output.\$activeUser.\$activePaket.\"%0A\")\r\
    \n\t}\r\
    \n} \r\
    \n:if ([:len \$param3] > 0) do={\r\
    \n :if (\$param1=\"ubah\") do={\r\
    \n\t:local username \"\$param2\"\r\
    \n\t:local paket \"\$param3\"\r\
    \n\t:local pakethabis \"\$param3 habis\"\r\
    \n\t/tool user-manager user clear-profiles numbers=\$username;\r\
    \n\t:if ((\$param3=\"Paket 500 MB\") || (\$param3=\"Paket 1 GB\")) do={\r\
    \n\t /tool user-manager user create-and-activate-profile profile=\"\$paket\
    \" customer=admin numbers=\$username;\r\
    \n\t} else={\r\
    \n\t /tool user-manager user create-and-activate-profile profile=\"\$paket\
    habis\" customer=admin numbers=\$username;\r\
    \n\t}\r\
    \n\t:set output (\"%0AUsername: \$username %0APerubahan paket menjadi:%0A\
    \$paket%0ASilahkan kunjungi http://ical.webiot.id\")\r\
    \n } else={ \r\
    \n\t:local username \"\$param1\"\r\
    \n\t:local password \"\$param2\"\r\
    \n\t:local paket \"\$param3\"\r\
    \n\t:local pakethabis \"\$param3 habis\"\r\
    \n\t/tool user-manager user add username=\$username password=\$password cu\
    stomer=admin;\r\
    \n\t/tool user-manager user clear-profiles numbers=\$username;\r\
    \n\t:if ((\$param3=\"Paket 500 MB\") || (\$param3=\"Paket 1 GB\")) do={\r\
    \n\t /tool user-manager user create-and-activate-profile profile=\"\$paket\
    \" customer=admin numbers=\$username;\r\
    \n\t} else={\r\
    \n\t /tool user-manager user create-and-activate-profile profile=\"\$paket\
    habis\" customer=admin numbers=\$username;\r\
    \n\t}\r\
    \n\t:set output (\"%0AUsername: \$username%0APassword: \$password%0A\$pake\
    t%0ASilahkan kunjungi http://ical.webiot.id\")\r\
    \n }\r\
    \n}\r\
    \n\$send chat=\$chatid text=(\"\$output\") mode=\"Markdown\"\r\
    \n:return true "
add dont-require-permissions=no name=tg_cmd_dhcp owner=admin policy=read \
    source=":local send [:parse [/system script get tg_sendMessage source]]\r\
    \n\r\
    \n:put \$chatid\r\
    \n:put \$from\r\
    \n\r\
    \n:local output\r\
    \n\r\
    \n:foreach activeIndex in=[/ip dhcp-server lease find] do={\r\
    \n:local activeAdr (\"*Address:* \".[/ip dhcp-server lease get value-name=\
    \"address\" \$activeIndex].\"%0A\")\r\
    \n:local activeMac (\"*Mac-Address:* \".[/ip dhcp-server lease get value-n\
    ame=\"mac-address\" \$activeIndex].\"%0A\")\r\
    \n#:local activeHost (\"*Host-name:* \".[/ip dhcp-server lease get value-n\
    ame=\"host-name\" \$activeIndex].\"%0A\")\r\
    \n:set output (\$output.\$activeAdr.\$activeMac.\$activeHost.\"%0A\")\r\
    \n}\r\
    \n \r\
    \n\$send chat=\$chatid text=(\"\$output\") mode=\"Markdown\""
add dont-require-permissions=no name=tg_cmd_host owner=admin policy=read \
    source=":local send [:parse [/system script get tg_sendMessage source]]\
    \n:local param1 [:pick \$params 0 [:find \$params \" \"]]\
    \n:local param2 [:pick \$params ([:find \$params \" \"]+1) [:len \$params]\
    ]\
    \n\
    \n:put \$params\
    \n:put \$param1\
    \n:put \$param2\
    \n:put \$chatid\
    \n:put \$from\
    \n\
    \n:local headEr (\"Perintah: /host black IP | /host aktif IP%0A       *Add\
    ress*      ||    *To Address*    ||     *MAC Address*     ||\")\
    \n:local output \
    \n:foreach activeIndex in=[/ip hotspot host find] do={\
    \n:local activeAddress ([/ip hotspot host get value-name=\"address\" \$act\
    iveIndex])\
    \n:local activeToAddress ([/ip hotspot host get value-name=\"to-address\" \
    \$activeIndex])\
    \n:local activeMACAddr ([/ip hotspot host get value-name=\"mac-address\" \
    \$activeIndex].\" || \")\
    \n:set output (\$output.\$activeAddress.\" || \".\$activeToAddress.\" || \
    \".\$activeMACAddr.\"%0A\")\
    \n:if (([:len [/ip hotspot active find address=\"\$activeToAddress\"]] = 0\
    ) && ([:len [/ip hotspot ip-binding find to-address=\"\$activeToAddress\"]\
    ] = 0) && ([:len [/ip firewall address-list find list=\"blackIP\" address=\
    \"\$activeToAddress\"]] = 0)) do={\
    \n/ip firewall address-list add list=\"blackIP\" address=\"\$activeToAddre\
    ss\" timeout=\"30d\";\
    \n}\
    \n}\
    \n:local actived\
    \n:foreach activeIndex2 in=[/ip hotspot active find] do={\
    \n:local activeUser ([/ip hotspot active get value-name=\"user\" \$activeI\
    ndex2])\
    \n:local activeAddress ([/ip hotspot active get value-name=\"address\" \$a\
    ctiveIndex2].\" || \")\
    \n:local activeMACAddr ([/ip hotspot active get value-name=\"mac-address\"\
    \_\$activeIndex2].\"%0A\")\
    \n:local activeLoginBy (\"*Login by:* \".[/ip hotspot active get value-nam\
    e=\"login-by\" \$activeIndex2].\" || \")\
    \n:local activeUptime (\"*Uptime:* \".[/ip hotspot active get value-name=\
    \"uptime\" \$activeIndex2].\" - \".[/tool user-manager user get [find user\
    name=\"\$activeUser\"] uptime-used].\"%0A\")\
    \n:local activeKuota (\"*Kuota:* \".[((([/ip hotspot active get value-name\
    =\"limit-bytes-in\" \$activeIndex2])-([/ip hotspot active get value-name=\
    \"bytes-in\" \$activeIndex2]))/1048576)].\" Mb / \".[((([/ip hotspot activ\
    e get value-name=\"limit-bytes-out\" \$activeIndex2])-([/ip hotspot active\
    \_get value-name=\"bytes-out\" \$activeIndex2]))/1048576)].\" Mb%0A\")\
    \n:set actived (\$actived.\$activeUser.\" || \".\$activeAddress.\$activeMA\
    CAddr.\$activeLoginBy.\$activeUptime.\$activeKuota.\"%0A\")\
    \n}\
    \n:local blackList\
    \n:foreach activeIndex2 in=[/ip firewall address-list find list=\"blackIP\
    \"] do={\
    \n:local activeAddress ([/ip firewall address-list get value-name=\"addres\
    s\" \$activeIndex2])\
    \n:set blackList (\$blackList.\$activeAddress.\"%0A\")\
    \n}\
    \n\
    \n:local blackIPKu\
    \n:if (\$param1=\"black\") do={\
    \n:local blackIP \"\$param2\"\
    \n/ip firewall address-list add list=\"blackIP\" address=\"\$blackIP\" tim\
    eout=\"30d\";\
    \n:set blackIPKu (\"%0A\$blackIP sudah masuk Daftar BlackIP%0A\")\
    \n}\
    \n:if (\$param1=\"aktif\") do={\
    \n:if (\$param2=\"all\") do={\
    \n/ip firewall address-list remove [find list=\"blackIP\"];\
    \n:set blackIPKu (\"%0ASemua sudah aktif dan keluar Daftar BlackIP%0A\")\
    \n} else={\
    \n:local blackIP \"\$param2\"\
    \n/ip firewall address-list remove [find address=\"\$blackIP\"];\
    \n:set blackIPKu (\"%0A\$blackIP sudah aktif dan keluar Daftar BlackIP%0A\
    \")\
    \n}\
    \n}\
    \n\
    \n\$send chat=\$chatid text=(\"*HOST*%0A\$headEr%0A\$output---------------\
    ------------%0A*BLACK LIST*%0A\$blackList%0A\$blackIPKu%0A----------------\
    -----------%0A*ACTIVE*%0A\$actived\") mode=\"Markdown\""
add dont-require-permissions=no name=logMikrotik owner=admin policy=\
    ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon source="#\
    \_BEGIN SETUP\r\
    \n:local scheduleName \"logMikrotik\"\r\
    \nlocal bot \"1391417232:AAGBb6wRz6nfzpP1F2NoDlceC_FkCwVNe5A\"\r\
    \nlocal ChatID \"1299622755\"\r\
    \n:local startBuf [:toarray [/log find message~\"Masuk\" || message~\"Gaga\
    l masuk\"]]\r\
    \n:local removeThese {\"telnet\";\"Ada yang pakai telnet\"}\r\
    \n# END SETUP\r\
    \n\r\
    \n# warn if schedule does not exist\r\
    \n:if ([:len [/system scheduler find name=\"\$scheduleName\"]] = 0) do={\r\
    \n  /log warning \"[LOGMON] ERROR: Schedule does not exist. Create schedul\
    e and edit script to match name\"\r\
    \n}\r\
    \n\r\
    \n# get last time\r\
    \n:local lastTime [/system scheduler get [find name=\"\$scheduleName\"] co\
    mment]\r\
    \n# for checking time of each log entry\r\
    \n:local currentTime\r\
    \n# log message\r\
    \n:local message\r\
    \n \r\
    \n# final output\r\
    \n:local output\r\
    \n\r\
    \n:local keepOutput false\r\
    \n# if lastTime is empty, set keepOutput to true\r\
    \n:if ([:len \$lastTime] = 0) do={\r\
    \n  :set keepOutput true\r\
    \n}\r\
    \n\r\
    \n:local counter 0\r\
    \n# loop through all log entries that have been found\r\
    \n:foreach i in=\$startBuf do={\r\
    \n \r\
    \n# loop through all removeThese array items\r\
    \n  :local keepLog true\r\
    \n  :foreach j in=\$removeThese do={\r\
    \n#   if this log entry contains any of them, it will be ignored\r\
    \n    :if ([/log get \$i message] ~ \"\$j\") do={\r\
    \n      :set keepLog false\r\
    \n    }\r\
    \n  }\r\
    \n  :if (\$keepLog = true) do={\r\
    \n   \r\
    \n   :set message [/log get \$i message]\r\
    \n\r\
    \n#   LOG DATE\r\
    \n#   depending on log date/time, the format may be different. 3 known for\
    mats\r\
    \n#   format of jan/01/2002 00:00:00 which shows up at unknown date/time. \
    Using as default\r\
    \n    :set currentTime [ /log get \$i time ]\r\
    \n#   format of 00:00:00 which shows up on current day's logs\r\
    \n   :if ([:len \$currentTime] = 8 ) do={\r\
    \n     :set currentTime ([:pick [/system clock get date] 0 11].\" \".\$cur\
    rentTime)\r\
    \n    } else={\r\
    \n#     format of jan/01 00:00:00 which shows up on previous day's logs\r\
    \n     :if ([:len \$currentTime] = 15 ) do={\r\
    \n        :set currentTime ([:pick \$currentTime 0 6].\"/\".[:pick [/syste\
    m clock get date] 7 11].\" \".[:pick \$currentTime 7 15])\r\
    \n      }\r\
    \n   }\r\
    \n    \r\
    \n#   if keepOutput is true, add this log entry to output\r\
    \n   :if (\$keepOutput = true) do={\r\
    \n     :set output (\$output.\$currentTime.\" %0A\".\$message.\"\\r\\n\")\
    \r\
    \n   }\r\
    \n\r\
    \n    :if (\$currentTime = \$lastTime) do={\r\
    \n     :set keepOutput true\r\
    \n     :set output \"\"\r\
    \n   }\r\
    \n  }\r\
    \n  :if (\$counter = ([:len \$startBuf]-1)) do={\r\
    \n   :if (\$keepOutput = false) do={    \r\
    \n     :if ([:len \$message] > 0) do={\r\
    \n        :set output (\$output.\$currentTime.\" %0A\".\$message.\"\\r\\n\
    \")\r\
    \n      }\r\
    \n    }\r\
    \n  }\r\
    \n  :set counter (\$counter + 1)\r\
    \n}\r\
    \n\r\
    \nif ([:len \$output] > 0) do={\r\
    \n  /system scheduler set [find name=\"\$scheduleName\"] comment=\$current\
    Time\r\
    \n  /tool fetch url=\"https://api.telegram.org/bot\$bot/sendmessage\?chat_\
    id=\$ChatID&text=MikroTik alert \$currentTime :%0A\$output\" keep-result=n\
    o;\r\
    \n}"
add dont-require-permissions=no name=tg_cmd_reboot owner=admin policy=\
    ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon source=\
    "/system reboot"
add dont-require-permissions=no name=tg_cmd_off owner=admin policy=\
    ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon source=\
    "/system shutdown"
/tool netwatch
add down-script=":local hh \$host\r\
    \n:local bot \"1391417232:AAGBb6wRz6nfzpP1F2NoDlceC_FkCwVNe5A\"\r\
    \n:local chat \"1299622755\"\r\
    \n:local datetime \"Tanggal: \$[/system clock get date] %0AJam: \$[/system\
    \_clock get time]\"\r\
    \n:local com [/tool netwatch get value-name=comment [find host=\$hh] comme\
    nt];\r\
    \n/tool fetch url=\"https://api.telegram.org/bot\$bot/sendmessage\\\?chat_\
    id=\$chat&text=\$datetime %0ARouter: \$com \$hh OFF \\E2\\9D\\8C \" keep-r\
    esult=no" host=192.168.1.2 interval=10s timeout=500ms up-script=":local hh\
    \_\$host\r\
    \n:local bot \"1391417232:AAGBb6wRz6nfzpP1F2NoDlceC_FkCwVNe5A\"\r\
    \n:local chat \"1299622755\"\r\
    \n:local datetime \"Tanggal: \$[/system clock get date] %0AJam: \$[/system\
    \_clock get time]\"\r\
    \n/tool fetch url=\"https://api.telegram.org/bot\$bot/sendmessage\\\?chat_\
    id=\$chat&text=\$datetime %0ARouter: \$hh ON \\E2\\9C\\85\" keep-result=no\
    "
add down-script=":local hh \$host\r\
    \n:local bot \"1391417232:AAGBb6wRz6nfzpP1F2NoDlceC_FkCwVNe5A\"\r\
    \n:local chat \"1299622755\"\r\
    \n:local datetime \"Tanggal: \$[/system clock get date] %0AJam: \$[/system\
    \_clock get time]\"\r\
    \n:local com [/tool netwatch get value-name=comment [find host=\$hh] comme\
    nt];\r\
    \n/tool fetch url=\"https://api.telegram.org/bot\$bot/sendmessage\\\?chat_\
    id=\$chat&text=\$datetime %0ARouter: \$com \$hh OFF \\E2\\9D\\8C \" keep-r\
    esult=no" host=192.168.31.254 interval=10s timeout=500ms up-script=":local\
    \_hh \$host\r\
    \n:local bot \"1391417232:AAGBb6wRz6nfzpP1F2NoDlceC_FkCwVNe5A\"\r\
    \n:local chat \"1299622755\"\r\
    \n:local datetime \"Tanggal: \$[/system clock get date] %0AJam: \$[/system\
    \_clock get time]\"\r\
    \n/tool fetch url=\"https://api.telegram.org/bot\$bot/sendmessage\\\?chat_\
    id=\$chat&text=\$datetime %0ARouter: \$hh ON \\E2\\9C\\85\" keep-result=no\
    "
add down-script=":local hh \$host\r\
    \n:local bot \"1391417232:AAGBb6wRz6nfzpP1F2NoDlceC_FkCwVNe5A\"\r\
    \n:local chat \"1299622755\"\r\
    \n:local datetime \"Tanggal: \$[/system clock get date] %0AJam: \$[/system\
    \_clock get time]\"\r\
    \n:local com [/tool netwatch get value-name=comment [find host=\$hh] comme\
    nt];\r\
    \n/tool fetch url=\"https://api.telegram.org/bot\$bot/sendmessage\\\?chat_\
    id=\$chat&text=\$datetime %0ARouter: \$com \$hh OFF \\E2\\9D\\8C \" keep-r\
    esult=no" host=192.168.2.2 interval=10s timeout=500ms up-script=":local hh\
    \_\$host\r\
    \n:local bot \"1391417232:AAGBb6wRz6nfzpP1F2NoDlceC_FkCwVNe5A\"\r\
    \n:local chat \"1299622755\"\r\
    \n:local datetime \"Tanggal: \$[/system clock get date] %0AJam: \$[/system\
    \_clock get time]\"\r\
    \n/tool fetch url=\"https://api.telegram.org/bot\$bot/sendmessage\\\?chat_\
    id=\$chat&text=\$datetime %0ARouter: \$hh ON \\E2\\9C\\85\" keep-result=no\
    "
add down-script=":local hh \$host\r\
    \n:local bot \"1391417232:AAGBb6wRz6nfzpP1F2NoDlceC_FkCwVNe5A\"\r\
    \n:local chat \"1299622755\"\r\
    \n:local datetime \"Tanggal: \$[/system clock get date] %0AJam: \$[/system\
    \_clock get time]\"\r\
    \n:local com [/tool netwatch get value-name=comment [find host=\$hh] comme\
    nt];\r\
    \n/tool fetch url=\"https://api.telegram.org/bot\$bot/sendmessage\\\?chat_\
    id=\$chat&text=\$datetime %0ARouter: \$com \$hh OFF \\E2\\9D\\8C \" keep-r\
    esult=no" host=192.168.31.1 interval=10s timeout=500ms up-script=":local h\
    h \$host\r\
    \n:local bot \"1391417232:AAGBb6wRz6nfzpP1F2NoDlceC_FkCwVNe5A\"\r\
    \n:local chat \"1299622755\"\r\
    \n:local datetime \"Tanggal: \$[/system clock get date] %0AJam: \$[/system\
    \_clock get time]\"\r\
    \n/tool fetch url=\"https://api.telegram.org/bot\$bot/sendmessage\\\?chat_\
    id=\$chat&text=\$datetime %0ARouter: \$hh ON \\E2\\9C\\85\" keep-result=no\
    "
add down-script=":local hh \$host\r\
    \n:local bot \"1391417232:AAGBb6wRz6nfzpP1F2NoDlceC_FkCwVNe5A\"\r\
    \n:local chat \"1299622755\"\r\
    \n:local datetime \"Tanggal: \$[/system clock get date] %0AJam: \$[/system\
    \_clock get time]\"\r\
    \n:local com [/tool netwatch get value-name=comment [find host=\$hh] comme\
    nt];\r\
    \n/tool fetch url=\"https://api.telegram.org/bot\$bot/sendmessage\\\?chat_\
    id=\$chat&text=\$datetime %0ARouter: \$com \$hh OFF \\E2\\9D\\8C \" keep-r\
    esult=no" host=192.168.1.1 interval=10s timeout=500ms up-script=":local hh\
    \_\$host\r\
    \n:local bot \"1391417232:AAGBb6wRz6nfzpP1F2NoDlceC_FkCwVNe5A\"\r\
    \n:local chat \"1299622755\"\r\
    \n:local datetime \"Tanggal: \$[/system clock get date] %0AJam: \$[/system\
    \_clock get time]\"\r\
    \n/tool fetch url=\"https://api.telegram.org/bot\$bot/sendmessage\\\?chat_\
    id=\$chat&text=\$datetime %0ARouter: \$hh ON \\E2\\9C\\85\" keep-result=no\
    "
/tool user-manager database
set db-path=user-manager
/tool user-manager profile profile-limitation
add from-time=0s limitation="Paket 1 GB" profile="Paket 1 GB" till-time=\
    23h59m59s weekdays=\
    sunday,monday,tuesday,wednesday,thursday,friday,saturday
add from-time=0s limitation=admin profile=admin till-time=23h59m59s weekdays=\
    sunday,monday,tuesday,wednesday,thursday,friday,saturday
add from-time=0s limitation="Paket 500 MB" profile="Paket 500 MB" till-time=\
    23h59m59s weekdays=\
    sunday,monday,tuesday,wednesday,thursday,friday,saturday
add from-time=0s limitation="Paket 1 jam habis" profile="Paket 1 jam" \
    till-time=23h59m59s weekdays=\
    sunday,monday,tuesday,wednesday,thursday,friday,saturday
add from-time=0s limitation="Paket 1 jam" profile="Paket 1 jam habis" \
    till-time=23h59m59s weekdays=\
    sunday,monday,tuesday,wednesday,thursday,friday,saturday
add from-time=0s limitation="Paket 3 jam habis" profile="Paket 3 jam" \
    till-time=23h59m59s weekdays=\
    sunday,monday,tuesday,wednesday,thursday,friday,saturday
add from-time=0s limitation="Paket 3 jam" profile="Paket 3 jam habis" \
    till-time=23h59m59s weekdays=\
    sunday,monday,tuesday,wednesday,thursday,friday,saturday
add from-time=0s limitation="Paket 5 jam habis" profile="Paket 5 jam" \
    till-time=23h59m59s weekdays=\
    sunday,monday,tuesday,wednesday,thursday,friday,saturday
add from-time=0s limitation="Paket 5 jam" profile="Paket 5 jam habis" \
    till-time=23h59m59s weekdays=\
    sunday,monday,tuesday,wednesday,thursday,friday,saturday
add from-time=0s limitation="Paket 1 hari habis" profile="Paket 1 hari" \
    till-time=23h59m59s weekdays=\
    sunday,monday,tuesday,wednesday,thursday,friday,saturday
add from-time=0s limitation="Paket 1 hari" profile="Paket 1 hari habis" \
    till-time=23h59m59s weekdays=\
    sunday,monday,tuesday,wednesday,thursday,friday,saturday
add from-time=0s limitation="Paket 1 Minggu habis" profile="Paket 1 Minggu" \
    till-time=23h59m59s weekdays=\
    sunday,monday,tuesday,wednesday,thursday,friday,saturday
add from-time=0s limitation="Paket 1 Minggu" profile="Paket 1 Minggu habis" \
    till-time=23h59m59s weekdays=\
    sunday,monday,tuesday,wednesday,thursday,friday,saturday
add from-time=0s limitation="Paket 1 Bulan habis" profile="Paket 1 Bulan" \
    till-time=23h59m59s weekdays=\
    sunday,monday,tuesday,wednesday,thursday,friday,saturday
add from-time=0s limitation="Paket 1 Bulan" profile="Paket 1 Bulan habis" \
    till-time=23h59m59s weekdays=\
    sunday,monday,tuesday,wednesday,thursday,friday,saturday
add from-time=0s limitation="Paket 1 Bulan min habis" profile=\
    "Paket 1 Bulan min" till-time=23h59m59s weekdays=\
    sunday,monday,tuesday,wednesday,thursday,friday,saturday
add from-time=0s limitation="Paket 1 Bulan min" profile=\
    "Paket 1 Bulan min habis" till-time=23h59m59s weekdays=\
    sunday,monday,tuesday,wednesday,thursday,friday,saturday
add from-time=0s limitation="Paket 1 Bulan max habis" profile=\
    "Paket 1 Bulan max" till-time=23h59m59s weekdays=\
    sunday,monday,tuesday,wednesday,thursday,friday,saturday
add from-time=0s limitation="Paket 1 Bulan max" profile=\
    "Paket 1 Bulan max habis" till-time=23h59m59s weekdays=\
    sunday,monday,tuesday,wednesday,thursday,friday,saturday
add from-time=0s limitation="Paket Gratis habis" profile="Paket Gratis" \
    till-time=23h59m59s weekdays=\
    sunday,monday,tuesday,wednesday,thursday,friday,saturday
add from-time=0s limitation="Paket Gratis" profile="Paket Gratis habis" \
    till-time=23h59m59s weekdays=\
    sunday,monday,tuesday,wednesday,thursday,friday,saturday
/tool user-manager router
add coa-port=1700 customer=admin disabled=no ip-address=127.0.0.1 log=\
    auth-fail name=Mikrotik shared-secret=10041987nm use-coa=no
add coa-port=1700 customer=admin disabled=no ip-address=192.168.1.1 log=\
    auth-fail name=ZTE shared-secret=10041987nm use-coa=no
add coa-port=1700 customer=admin disabled=no ip-address=192.168.2.1 log=\
    auth-fail name=iCAL shared-secret=10041987nm use-coa=no
add coa-port=1700 customer=admin disabled=no ip-address=192.168.31.2 log=\
    auth-fail name="Mi Wifi" shared-secret=10041987nm use-coa=no
/tool user-manager user
add customer=admin disabled=no ipv6-dns=:: password=bpk01 shared-users=3 \
    username=bapak wireless-enc-algo=none wireless-enc-key="" wireless-psk=""
add customer=admin disabled=no ipv6-dns=:: password=10041987nm shared-users=\
    unlimited username=admin wireless-enc-algo=none wireless-enc-key="" \
    wireless-psk=""
add customer=admin disabled=no ipv6-dns=:: password=nada3 shared-users=1 \
    username=nada wireless-enc-algo=none wireless-enc-key="" wireless-psk=""