lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


what is this code not generating pcap file in pc with ip address 192.168.16.52 when run from remote computer

function tcpdump_file(pwd,user,ip,filename,cmd)
os.execute ('sshpass -p '..pwd..' ssh -o StrictHostKeyChecking=no '..user..'@'..ip..'<<exit')
if cmd=='start' then
os.execute('tcpdump -i 2 -w '..filename..' &')
--os.execute('exit')
elseif cmd=='stop' then
os.execute("kill -9 `ps -ef | grep "..filename.." | grep -v grep | awk '{print $2}'`")
end
os.execute('exit')
end
tcpdump_file("lee34","root","192.168.16.52","test123.pcap",'start')