#! /bin/sh WIFI="rausb0" dump_start() { if [ "`/sbin/ifconfig | grep $WIFI`" != "" ]; then echo "Starting airodump-ng: " screen -d -m -S dump airodump-ng -w /root/cap/dump -c 6 --ivs $WIFI fi } dump_stop() { kill -9 `screen -ls|grep dump|cut -d "." -f 1` } dump_restart() { dump_stop sleep 2 dump_start } case "$1" in 'start') dump_start ;; 'stop') dump_stop ;; 'restart') dump_restart ;; *) echo "Usage: $0 start|stop|restart" ;; esac