Q
Q
qreodium2021-05-02 17:14:38
bash
qreodium, 2021-05-02 17:14:38

How to run a bash script when a specific ethernet frame is received?

I want to run a script as root when receiving a wol frame to shut down the computer. So that from the mobile application it would be possible to turn the server on and off. I'm not well versed in linux, so tell me how can I do this?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
K
ky0, 2021-05-02
@qreodium

See marek.terminus.sk/prog/ipt_sysrq.shtml

S
SquareWheel, 2021-05-02
@SquareWheel

The short answer is not to pervert, use a ready-made solution
The answer is longer - write a separate script that will be launched from a cron with a small cd, parse the sniffer output, consist of a data processing cycle, and already encapsulate the script for cutting everything and everything into it, subject to the conditions. No, I will not even try to write this obscurantism.
But it's easier not to be perverted. Or at least use a more approachable programming language.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question