OpenWrt Forum Archive

Topic: TCPdump startup script not working

The content of this topic has been archived on 29 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Hello,

I'm trying to create a startup script for following tcpdump command:
tcpdump -i eth1.1 -l arp and ether[0x26:1]=192 and ether[0x27:1]=168 and ether[0x28:1]=1 and ether[0x29:1]=200|while read -r line; do etherwake -i eth1.1 00:00:00:00:00:00; done&
(MAC is empty for privacy wink )

This script sends a wake on lan magic packet to the destination host, when a client is accessing it (over web or smb for example). The script works fine, but not at boot.

I tried creating a script, which looks like following:

#!/bin/sh /etc/rc.common
START=99
USE_PROCD=1

COMMAND="tcpdump -i eth1.1 -l arp and ether[0x26:1]=192 and ether[0x27:1]=168 and ether[0x28:1]=1 and ether[0x29:1]=200|while read -r line; do etherwake -i eth1.1 00:00:00:00:00:00; done&"

start_service() {
        procd_open_instance
        procd_set_param command $COMMAND
}

Can someone help to get this working?

(Last edited by asldjlajhdwat on 28 Aug 2017, 21:43)

Start with ordinary commands in file /etc/rc.local:

sleep 30
tcpdump ...

The discussion might have continued from here.