mirror of
https://github.com/sshuttle/sshuttle.git
synced 2025-04-02 12:16:20 +02:00
Some Linux distros, like Alpine, Arch, etc and some BSDs, like FreeBSD, are now shipping with python3.6 as the default python3. Both the client and the server are failing to run in this distros, because we are specifically looking for python3.5. These changes make the run shell script use python3 if the version is greater than 3.5, otherwise falling back as usual. On the server any version of python3 will do, use it before falling back to python, as the server code can run with any version of python3.
18 lines
392 B
Bash
Executable File
18 lines
392 B
Bash
Executable File
#!/usr/bin/env sh
|
|
set -e
|
|
export PYTHONPATH="$(dirname $0):$PYTHONPATH"
|
|
|
|
python_best_version() {
|
|
if [ -x "$(command -v python3)" ]; then
|
|
if python3 -c "import sys; sys.exit(not sys.version_info > (3, 5))"; then
|
|
exec python3 "$@"
|
|
fi
|
|
elif [ -x "$(command -v python2.7)" ]; then
|
|
exec python2.7 "$@"
|
|
else
|
|
exec python "$@"
|
|
fi
|
|
}
|
|
|
|
python_best_version -m "sshuttle" "$@"
|