Update scripts to call python2 instead of python when python is not version 2

This commit is contained in:
Pierre LALET 2016-03-15 09:08:41 +01:00
parent 7a546611c3
commit 6dcd891468
2 changed files with 13 additions and 3 deletions

View File

@ -1,3 +1,8 @@
#! /bin/sh
DIR=$(dirname $0)
PYTHONPATH=$DIR exec python -m scapy.__init__
if python --version | grep -q '^Python 2'; then
PYTHON=python
else
PYTHON=python2
fi
PYTHONPATH=$DIR exec $PYTHON -m scapy.__init__

View File

@ -1,8 +1,13 @@
#! /bin/bash
DIR=$(dirname $0)/..
if python --version | grep -q '^Python 2'; then
PYTHON=python
else
PYTHON=python2
fi
if [ "$*" == "" ]
then
PYTHONPATH=$DIR exec python ${DIR}/scapy/tools/UTscapy.py -t regression.uts -f html -l -o /tmp/scapy_regression_test_$(date +%Y%m%d-%H%M%S).html
PYTHONPATH=$DIR exec $PYTHON ${DIR}/scapy/tools/UTscapy.py -t regression.uts -f html -l -o /tmp/scapy_regression_test_$(date +%Y%m%d-%H%M%S).html
else
PYTHONPATH=$DIR exec python ${DIR}/scapy/tools/UTscapy.py "$@"
PYTHONPATH=$DIR exec $PYTHON ${DIR}/scapy/tools/UTscapy.py "$@"
fi