Hello! Sorry for my English:) I need run a script when packet sniffer is stopped. But i have error with file name. File name must be: “usb1/current date time”.
:global myVar;
:set myVar “/system clock get time”;
if ([ /tool sniffer get running] = no) do={
:put “$myVar”;
tool sniffer set file-name=$myVar
/ tool sniffer start}
File name must be new because when i started sniffer old file is deleting. Please help !!!
try this
{
local time [/system clock get time]
local status [/tool sniffer get running]
if ($status = false ) do={ put $time; tool sniffer set file-name=$time; / tool sniffer start}
}
Thank you!!! Good solution.
How can i insert "usb1" before “$time” and date after “$time” in file name?
I try to add. But i have error.
{
local time [/system clock get time]
local date [/system clock get date]
local status [/tool sniffer get running]
if ($status = false ) do={ put $time; put $date; tool sniffer set file-name= usb1/$time,$date; / tool sniffer start}
}
{
local 1 [pick [sys clock get date ] 0 3]
local 2 [pick [sys clock get date ] 4 6]
loca 3 [pick [sys clock get date ] 7 12]
local time [/system clock get time]
local date “$2$1$3”
local status [/tool sniffer get running]
if ($status = false ) do={ put $time; put $date; tool sniffer set file-name=“usb1/$time,$date” ; / tool sniffer start}
}
Thank you! But i have new problem. Sniffer didn’t stop when the file-limit has been reached. How can i stop it in script?
Like this: if ( / tool sniffer file-limit reached) do = { / tool sniffer stop} /////Error
local time [/system clock get time];
tool sniffer set file-name="usb1/$time";
Result is file name like: 01:05:25 How can i delete “:” in file neame?
File didnt export into windows.