How to use keyboard shortcuts with scripts?
Posted: Mon Feb 06, 2012 3:23 pm
Hii guys
I want to insert a pppoe scan command in a script like this:
every thing going ok till the (:put D) which dump the scan result to file it's not executed
I appreciate if any one can help me to pass this keyboard shortcut to script
I want to insert a pppoe scan command in a script like this:
Code: Select all
:global result;
:global resultLen;
:global startLoc;
:global endLoc;
:global Evilmac;
:global i;
:global mac mac;
:global End 0;
:global line "";
:global start 0;
:foreach i in=[/file find ] do={
:if ([/file get $i value-name=name ] = "console-dump.txt") do={
/file remove $i ;
}
}
/interface pppoe-client scan ether2 duration=00:00:10 <---This is the command
:put D <---- the troubles arise here
:put Q
:delay 2s
:global content [/file get [/file find name=console-dump.txt] contents] ;
:global contentLen [ :len $content ] ;
:do {
:set End [:find $content "\n" $start ] ;
:set line [:pick $content $start $End] ;
:set start ($End + 1) ;
:if ( [:pick $line 0 1] != "#" && [:pick $line 0 1] != "S" ) do={
:local entry [:pick $line 0 ($End -1) ]
:global result ($entry);
:global resultLen [:len $result];
:global startLoc [:find $result "00:"];
:global endLoc ($startLoc + 17);
:global Evilmac [:pick $result $startLoc $endLoc];
:put ($Evilmac);
:log warning "Fake PPPOE Server Detected!";
/interface wireless access-list add mac-address=$Evilmac authentication=no forwarding=no;
/ip firewall filter add chain=forward src-mac-address=$Evilmac action=drop;
}
} while=($End < $contentLen)
I appreciate if any one can help me to pass this keyboard shortcut to script