#!/bin/sh
trap '
KSRV_PID="`pgrep -f /opt/kismet/bin/kismet_server`"
if [ ! -z "$KSRV_PID" ]; then
	kill "$KSRV_PID"
fi
while pgrep -f /opt/kismet/bin/kismet_server >/dev/null; do
	sleep 1
done
dbus-send --system --type=signal --dest=com.nokia.wlancond /com/nokia/mce/signal com.nokia.mce.signal.sig_device_mode_ind string:normal
exit
' EXIT SIGINT SIGTERM
dbus-send --system --type=signal --dest=com.nokia.wlancond /com/nokia/mce/signal com.nokia.mce.signal.sig_device_mode_ind string:flight
/opt/kismet/bin/kismet_server "$@"

