Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
48 views2 pages

User Profile Hotspot Scripts

The document contains scripts for managing user profiles in a hotspot system, specifically handling login events for different time intervals (1 hour, 10 minutes, 12 hours, and 7 days). Each script checks the user's comment and schedules tasks accordingly, updating user comments based on the next run time of the scheduled tasks. The scripts ensure that users are assigned appropriate time intervals and their comments are updated with relevant expiration information.

Uploaded by

suweino_harun
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
48 views2 pages

User Profile Hotspot Scripts

The document contains scripts for managing user profiles in a hotspot system, specifically handling login events for different time intervals (1 hour, 10 minutes, 12 hours, and 7 days). Each script checks the user's comment and schedules tasks accordingly, updating user comments based on the next run time of the scheduled tasks. The scripts ensure that users are assigned appropriate time intervals and their comments are updated with relevant expiration information.

Uploaded by

suweino_harun
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

User Profile Hotspot Scripts:

1h_10000: on login

:put (",rem,10000,1h,10000,,Enable,"); {:local comment [ /ip hotspot user get [/ip hotspot user
find where name="$user"] comment]; :local ucode [:pic $comment 0 2]; :if ($ucode = "vc" or
$ucode = "up" or $comment = "") do={ :local date [ /system clock get date ];:local year [ :pick
$date 7 11 ];:local month [ :pick $date 0 3 ]; /sys sch add name="$user" disable=no start-
date=$date interval="1h"; :delay 5s; :local exp [ /sys sch get [ /sys sch find where name="$user"
] next-run]; :local getxp [len $exp]; :if ($getxp = 15) do={ :local d [:pic $exp 0 6]; :local t [:pic $exp
7 16]; :local s ("/"); :local exp ("$d$s$year $t"); /ip hotspot user set comment="$exp" [find where
name="$user"];}; :if ($getxp = 8) do={ /ip hotspot user set comment="$date $exp" [find where
name="$user"];}; :if ($getxp > 15) do={ /ip hotspot user set comment="$exp" [find where
name="$user"];};:delay 5s; /sys sch remove [find where name="$user"]; [:local mac $"mac-
address"; /ip hotspot user set mac-address=$mac [find where name=$user]]}}

10m_1000: on login

:put (",rem,1000,10m,1000,,Enable,"); {:local comment [ /ip hotspot user get [/ip hotspot user
find where name="$user"] comment]; :local ucode [:pic $comment 0 2]; :if ($ucode = "vc" or
$ucode = "up" or $comment = "") do={ :local date [ /system clock get date ];:local year [ :pick
$date 7 11 ];:local month [ :pick $date 0 3 ]; /sys sch add name="$user" disable=no start-
date=$date interval="10m"; :delay 5s; :local exp [ /sys sch get [ /sys sch find where
name="$user" ] next-run]; :local getxp [len $exp]; :if ($getxp = 15) do={ :local d [:pic $exp 0 6];
:local t [:pic $exp 7 16]; :local s ("/"); :local exp ("$d$s$year $t"); /ip hotspot user set
comment="$exp" [find where name="$user"];}; :if ($getxp = 8) do={ /ip hotspot user set
comment="$date $exp" [find where name="$user"];}; :if ($getxp > 15) do={ /ip hotspot user set
comment="$exp" [find where name="$user"];};:delay 5s; /sys sch remove [find where
name="$user"]; [:local mac $"mac-address"; /ip hotspot user set mac-address=$mac [find
where name=$user]]}}

12_jam: on login

:put (",rem,20000,12h,20000,,Enable,Disable,"); :local mode "X"; {:local date [ /system clock get
date ];:local year [ :pick $date 7 11 ];:local month [ :pick $date 0 3 ];:local comment [ /ip hotspot
user get [/ip hotspot user find where name="$user"] comment]; :local ucode [:pic $comment 0
2]; :if ($ucode = "vc" or $ucode = "up" or $comment = "") do={ /sys sch add name="$user"
disable=no start-date=$date interval="12h"; :delay 2s; :local exp [ /sys sch get [ /sys sch find
where name="$user" ] next-run]; :local getxp [len $exp]; :if ($getxp = 15) do={ :local d [:pic $exp
0 6]; :local t [:pic $exp 7 16]; :local s ("/"); :local exp ("$d$s$year $t"); /ip hotspot user set
comment="$exp $mode" [find where name="$user"];}; :if ($getxp = 8) do={ /ip hotspot user set
comment="$date $exp $mode" [find where name="$user"];}; :if ($getxp > 15) do={ /ip hotspot
user set comment="$exp $mode" [find where name="$user"];}; /sys sch remove [find where
name="$user"]; [:local mac $"mac-address"; /ip hotspot user set mac-address=$mac [find
where name=$user]]}}
seminggu: on login

:put (",rem,30000,7d,30000,,Disable,"); {:local comment [ /ip hotspot user get [/ip hotspot user
find where name="$user"] comment]; :local ucode [:pic $comment 0 2]; :if ($ucode = "vc" or
$ucode = "up" or $comment = "") do={ :local date [ /system clock get date ];:local year [ :pick
$date 7 11 ];:local month [ :pick $date 0 3 ]; /sys sch add name="$user" disable=no start-
date=$date interval="7d"; :delay 5s; :local exp [ /sys sch get [ /sys sch find where name="$user"
] next-run]; :local getxp [len $exp]; :if ($getxp = 15) do={ :local d [:pic $exp 0 6]; :local t [:pic $exp
7 16]; :local s ("/"); :local exp ("$d$s$year $t"); /ip hotspot user set comment="$exp" [find where
name="$user"];}; :if ($getxp = 8) do={ /ip hotspot user set comment="$date $exp" [find where
name="$user"];}; :if ($getxp > 15) do={ /ip hotspot user set comment="$exp" [find where
name="$user"];};:delay 5s; /sys sch remove [find where name="$user"]}}

You might also like