mirror of https://github.com/secdev/scapy.git
getopt replaced by shell operations
This commit is contained in:
parent
fe715ab700
commit
a55b04efa5
13
run_scapy
13
run_scapy
|
@ -2,16 +2,17 @@
|
|||
DIR=$(dirname "$0")
|
||||
if [ -z "$PYTHON" ]
|
||||
then
|
||||
ARGS=$(getopt 23 "$*" 2> /dev/null)
|
||||
for arg in $ARGS
|
||||
ARGS=""
|
||||
for arg in "$@"
|
||||
do
|
||||
case $arg
|
||||
in
|
||||
-2) PYTHON=python2; shift;;
|
||||
-3) PYTHON=python3; shift;;
|
||||
--) PYTHON=python3; break;;
|
||||
-2) PYTHON=python2;;
|
||||
-3) PYTHON=python3;;
|
||||
*) ARGS="$ARGS $arg";;
|
||||
esac
|
||||
done
|
||||
PYTHON=${PYTHON:-python3}
|
||||
fi
|
||||
$PYTHON --version > /dev/null 2>&1
|
||||
if [ ! $? -eq 0 ]
|
||||
|
@ -19,4 +20,4 @@ then
|
|||
echo "WARNING: '$PYTHON' not found, using 'python' instead."
|
||||
PYTHON=python
|
||||
fi
|
||||
PYTHONPATH=$DIR exec "$PYTHON" -m scapy "$@"
|
||||
PYTHONPATH=$DIR exec "$PYTHON" -m scapy $ARGS
|
||||
|
|
Loading…
Reference in New Issue