bash - Reading realtime output from airodump-ng -
when execute command airodump-ng mon0 >> output.txt , output.txt empty. need able run airodump-ng mon0 , after 5 seconds stop command , have access output. thoughts should begin look? using bash.
start command background process, sleep 5 seconds, kill background process. may need redirect different stream stdout capturing output in file. this thread mentions stderr (which fd 2). can't verify here, can check descriptor number strace. command should show this:
$ strace airodump-ng mon0 2>&1 | grep ^write ... write(2, "... the number in write statement file descriptor airodump-ng writes to.
the script might (assuming stderr needs redirected):
#!/bin/bash { airodump-ng mon0 2>> output.txt; } & pid=$! sleep 5 kill -term $pid cat output.txt
Comments
Post a Comment