Refactor .bat files + default to Python 3

This commit is contained in:
gpotter2 2019-02-24 12:48:54 +01:00
parent b1b1fc87e4
commit 270461ed06
4 changed files with 12 additions and 31 deletions

View File

@ -1,5 +1,4 @@
#! /bin/sh
DIR=$(dirname $0)
PYTHONDONTWRITEBYTECODE=True
PYTHON=${PYTHON:-python}
PYTHON=${PYTHON:-python3}
PYTHONPATH=$DIR exec $PYTHON -m scapy $@

View File

@ -1,8 +1,8 @@
@echo off
call run_scapy_py2.bat --nopause
if errorlevel 1 (
call run_scapy_py3.bat --nopause
)
if errorlevel 1 (
PAUSE
)
set PYTHONPATH=%~dp0
IF "%PYTHON%" == "" set PYTHON=python3
WHERE %PYTHON% >nul 2>&1
IF %ERRORLEVEL% NEQ 0 set PYTHON=python
%PYTHON% -m scapy %*
title Scapy - dead
PAUSE

View File

@ -1,13 +1,4 @@
@echo off
set PYTHONPATH=%~dp0
set PYTHONDONTWRITEBYTECODE=True
if "%1"=="--nopause" (
set nopause="True"
python -m scapy
) else (
set nopause="False"
python -m scapy %*
)
if %errorlevel%==1 if NOT "%nopause%"=="True" (
PAUSE
)
set PYTHON=python
call run_scapy.bat

View File

@ -1,13 +1,4 @@
@echo off
set PYTHONPATH=%~dp0
set PYTHONDONTWRITEBYTECODE=True
if "%1"=="--nopause" (
set nopause="True"
python3 -m scapy
) else (
set nopause="False"
python3 -m scapy %*
)
if %errorlevel%==1 if NOT "%nopause%"=="True" (
PAUSE
)
set PYTHON=python3
call run_scapy.bat