Community discussions

MikroTik App
 
abab_rafiq
Member Candidate
Member Candidate
Topic Author
Posts: 118
Joined: Thu Aug 24, 2006 12:47 pm
Location: Dhaka

two command in an script

Tue Jan 16, 2007 7:16 am

Dear,
Im shy to ask u this question, where I put two command myself but forget HOW do I did it.

15 name="link21_stop" owner="admin"
policy=ftp,reboot,read,write,policy,test,winbox,password
last-started=jan/16/2007 09:00:00 run-count=2
source=
/ppp secret set [find name=link21] disable=yes
/interface pppoe-server remove [find user=link21]

This way I put two command together.
Please give me the whole command.

Rafiq...
 
User avatar
raivis-v
Frequent Visitor
Frequent Visitor
Posts: 55
Joined: Thu Jul 14, 2005 10:21 am
Location: Latvia, Riga

Re: two command in an script

Tue Jan 16, 2007 11:47 am

I am not sure of what you are asking. Could you be more specific what is wrong and what do you want to get?
 
changeip
Forum Guru
Forum Guru
Posts: 3830
Joined: Fri May 28, 2004 5:22 pm

Wed Jan 17, 2007 12:57 am

first just create a script (not scheduler) to run those 2 commands. Then, schedule that script to run. The scheduler will just have a single line, the name of the script to run. The script then hold the 2 lines.

/ppp secret set [find name=link21] disable=yes
/interface pppoe-server remove [find user=link21]

should be

/ppp secret set [/ppp secret find name=link21] disable=yes
/interface pppoe-server remove [/interface pppoe-server find user=link21]

You have to make sure find has a full path when running as a script.

Sam
 
abab_rafiq
Member Candidate
Member Candidate
Topic Author
Posts: 118
Joined: Thu Aug 24, 2006 12:47 pm
Location: Dhaka

Wed Jan 17, 2007 9:19 am

I wrote this script myself. But just forgot how do I gather all together in one line.
Dear changeip your suggestion is not working now, and I tried this and otherway for several time.

Please help me.

Rafiq...
 
abab_rafiq
Member Candidate
Member Candidate
Topic Author
Posts: 118
Joined: Thu Aug 24, 2006 12:47 pm
Location: Dhaka

Wed Jan 17, 2007 9:47 am

OK
I found it

the whole script is for making user for 12 hrs [from 9 PM to 9 PM like this way].

add name=rafiq source={/ppp secret set[find name=rafiqtest] disable=yes
{... /interface pppoe-server remove[find user=rafiqtest]}

Then make a schedule for user rafiqtest.

add name=rafiq on-event=rafiq start-time=21:00:0
0 interval=1d

Above script is for disable user and kick him out from pppoe-server interface.

For enable user and run that script at 9 PM, just write a script for enable the user from /ppp secret and add that script in schduler.


Rafiq...

Who is online

Users browsing this forum: No registered users and 59 guests