Page 1 of 1

how i can disable and then enable pppoe users automatic ?

Posted: Sat Aug 12, 2017 9:38 am
by ASRCH
Hi everyone :

In our company there are about 60 Internet users. The head of the company said that some users will have Internet access at certain times. Please help me with script and Schedule.

Some users will connect to the Internet at 7 o'clock in the morning and disconnect at 5 o'clock in the afternoon and then connect to the Internet again tomorrow morning at 7 o'clock in the morning.

Because I'm not a professional, please explain it in plain language and step by step.
Thanks to the distinguished engineers.

Re: how i can disable and then enable pppoe users automatic ?

Posted: Sun Aug 13, 2017 12:18 pm
by ASRCH
Please help me .

Re: how i can disable and then enable pppoe users automatic ?

Posted: Sun Aug 13, 2017 1:00 pm
by JohnTRIVOLTA
Please help me .
This is my example:
/system scheduler
add name=EnableHSusers on-event="system script run enableHSusers" policy=\
    ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon \
    start-date=aug/13/2017 start-time=08:00:00
add name=DisableHSusers on-event=" system script run disableHSusers" policy=\
    ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon \
    start-date=aug/13/2017 start-time=17:00:00
/system script
add name=enableHSusers owner=admin policy=\
    ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon source=\
    "ip hotspot user enable user1,user2,user3"
add name=disableHSusers owner=admin policy=\
    ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon source=\
    "ip hotspot user disable user1,user2,user3"
Make two scripts for enable and disable of the HS users you want and after that make two schedules for enabling and disabling for necessary time !

Re: how i can disable and then enable pppoe users automatic ?

Posted: Sun Aug 13, 2017 3:36 pm
by ASRCH
Mercy John
But I do not have a HotSpot. My users use ppp\secret account and DHCP pool and profile .
Thanks for helping me.

Re: how i can disable and then enable pppoe users automatic ?

Posted: Sun Aug 13, 2017 5:59 pm
by JohnTRIVOLTA
Mercy John
But I do not have a HotSpot. My users use ppp\secret account and DHCP pool and profile .
Thanks for helping me.
Sorry, the setting is the same, just replace with " ppp secret disable user1,user2,user3" and t "ppp secret enable user1,user2,user3" scripts .Change the name of the schedule and the scripts of your choice or change HS with PPP only !

Re: how i can disable and then enable pppoe users automatic ?

Posted: Sun Aug 13, 2017 6:29 pm
by DeCr0pt
If you are want disable multiple ppp profiles just use array and make foreach example like this:
:global ppplimit [:toarray ppp1,ppp2,ppp4]
:foreach i in $ppplimit do {
/ppp secret disable $i
}
Add this to scheduler and run it on time what you want, if you want make "enable" script too, just copy a script and just type enable instead of disable

Re: how i can disable and then enable pppoe users automatic ?

Posted: Wed Aug 16, 2017 1:12 pm
by ASRCH
Thank you John and DeCr0pt
This will only be done for the same date as it was set. How should change every day of Date?