scapy/run_scapy

24 lines
427 B
Plaintext
Raw Normal View History

#! /bin/sh
DIR=$(dirname "$0")
if [ -z "$PYTHON" ]
then
2020-04-04 09:54:58 +00:00
ARGS=""
for arg in "$@"
do
case $arg
in
2020-04-04 09:54:58 +00:00
-2) PYTHON=python2;;
-3) PYTHON=python3;;
*) ARGS="$ARGS $arg";;
esac
done
2020-04-04 09:54:58 +00:00
PYTHON=${PYTHON:-python3}
fi
$PYTHON --version > /dev/null 2>&1
if [ ! $? -eq 0 ]
then
echo "WARNING: '$PYTHON' not found, using 'python' instead."
PYTHON=python
fi
2020-04-04 09:54:58 +00:00
PYTHONPATH=$DIR exec "$PYTHON" -m scapy $ARGS