openbsd-ports/net/kismet/patches/patch-scripts_kismet_in
robert 2498eb4790 Import of kismet-2005-07-R1a.
Kismet is an 802.11 layer2 wireless network detector, sniffer, and
intrusion detection system.  Kismet will work with any wireless card
which supports raw monitoring (rfmon) mode, and can sniff 802.11b,
802.11a, and 802.11g traffic.

Kismet identifies networks by passively collecting packets and detecting
standard named networks, detecting (and given time, decloaking) hidden
networks, and infering the presence of nonbeaconing networks via data
traffic.

from Matthias Kilian <kili@outback.escape.de> and from a lot of
other people.
2005-07-27 21:37:26 +00:00

45 lines
1.1 KiB
Plaintext

$OpenBSD: patch-scripts_kismet_in,v 1.1.1.1 2005/07/27 21:37:26 robert Exp $
--- scripts/kismet.in.orig Wed Jun 22 06:22:08 2005
+++ scripts/kismet.in Sun Jun 26 12:22:44 2005
@@ -7,8 +7,6 @@ BIN=@bindir@
GREP_OPTIONS=""
-set -m
-
gui=`grep -e "^gui=" ${ETC}/kismet_ui.conf | cut -d= -f2 | tr -d " \t"`
piddir=`grep -e "^piddir=" ${ETC}/kismet.conf | cut -d= -f2 | tr -d " \t"`
@@ -61,21 +59,18 @@ servpid=$!
echo "Waiting for server to start before starting UI..."
sleep 4
-kill -0 $servpid 2>/dev/null
-if test "$?" != "0" ; then
- # Don't print anything here so that users don't get confused, just die and let
- # them read the server fatal errors
+exit_kismet() {
+ kill -0 $servpid && echo Killing server... && kill $servpid
+ echo Kismet exited.
+}
+
+if kill -0 $servpid 2>/dev/null; then
+ trap exit_kismet EXIT INT TERM
+else
+ # Don't print anything here so that users don't get confused,
+ # just die and let them read the server fatal errors
exit 1
fi
echo "Starting UI..."
${BIN}/kismet_client $client
-
-if test "$?" != "5"; then
- echo "Killing server..."
- kill $servpid
- wait %-
-fi
-
-echo "Kismet exited."
-