Friday, 20 May 2016

Disable and Enable Ethernet By Time Scheduler

#################Time Base Enable and Disable Ethernet###############
:log info "Ether2 Chaneged Name By HAMZA KHALIL"
interface ethernet
set [find default-name=ether2] name=ether2
:log info "Ether2 Added New Comment By HAMZA KHALIL"
set [ find default-name=ether2 ] comment="Time Base By HAMZA KHALIL"

/system script
add name=Disable policy=ftp,reboot,read,write,policy,test,winbox,password,sniff,sensitive,api \
    source=":log info \"Ether2 Disable By HAMZA KHALIL\"\r\
    \ninterface ethernet disable [find comment=\"Time Base By HAMZA KHALIL\"]"
add name=Enable policy=ftp,reboot,read,write,policy,test,winbox,password,sniff,sensitive,api \
    source=":log info \"Ether2 Enable By HAMZA KHALIL\"\r\
    \ninterface ethernet enable [find comment=\"Time Base By HAMZA KHALIL\"]"
/system scheduler
add interval=12h name="Ether2 Disable" on-event=Disable policy=\
    ftp,reboot,read,write,policy,test,winbox,password,sniff,sensitive,api start-date=feb/01/2016 \
    start-time=21:00:00
add interval=12h name="Ether2 Enable" on-event=Enable policy=\
    ftp,reboot,read,write,policy,test,winbox,password,sniff,sensitive,api start-date=feb/01/2016 \
    start-time=08:00:00

No comments:

Post a Comment