Skip to content

Commit a55b04e

Browse files
committed
getopt replaced by shell operations
1 parent fe715ab commit a55b04e

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

run_scapy

+7-6
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,22 @@
22
DIR=$(dirname "$0")
33
if [ -z "$PYTHON" ]
44
then
5-
ARGS=$(getopt 23 "$*" 2> /dev/null)
6-
for arg in $ARGS
5+
ARGS=""
6+
for arg in "$@"
77
do
88
case $arg
99
in
10-
-2) PYTHON=python2; shift;;
11-
-3) PYTHON=python3; shift;;
12-
--) PYTHON=python3; break;;
10+
-2) PYTHON=python2;;
11+
-3) PYTHON=python3;;
12+
*) ARGS="$ARGS $arg";;
1313
esac
1414
done
15+
PYTHON=${PYTHON:-python3}
1516
fi
1617
$PYTHON --version > /dev/null 2>&1
1718
if [ ! $? -eq 0 ]
1819
then
1920
echo "WARNING: '$PYTHON' not found, using 'python' instead."
2021
PYTHON=python
2122
fi
22-
PYTHONPATH=$DIR exec "$PYTHON" -m scapy "$@"
23+
PYTHONPATH=$DIR exec "$PYTHON" -m scapy $ARGS

0 commit comments

Comments
 (0)