mirror of
https://github.com/sshuttle/sshuttle.git
synced 2024-11-21 15:33:23 +01:00
client: workaround for idiotic ArchLinux renaming of python to python2.
First try running under python2, then python if that doesn't exist.
This commit is contained in:
parent
4fde980f46
commit
a62975e0ce
@ -102,7 +102,7 @@ class FirewallClient:
|
||||
self.subnets_include = subnets_include
|
||||
self.subnets_exclude = subnets_exclude
|
||||
self.dnsport = dnsport
|
||||
argvbase = ([sys.argv[0]] +
|
||||
argvbase = ([sys.argv[1], sys.argv[0], sys.argv[1]] +
|
||||
['-v'] * (helpers.verbose or 0) +
|
||||
['--firewall', str(port), str(dnsport)])
|
||||
if ssyslog._p:
|
||||
|
3
main.py
Executable file → Normal file
3
main.py
Executable file → Normal file
@ -1,4 +1,3 @@
|
||||
#!/usr/bin/env python
|
||||
import sys, os, re
|
||||
import helpers, options, client, server, firewall, hostwatch
|
||||
import compat.ssubprocess as ssubprocess
|
||||
@ -71,7 +70,7 @@ firewall (internal use only)
|
||||
hostwatch (internal use only)
|
||||
"""
|
||||
o = options.Options(optspec)
|
||||
(opt, flags, extra) = o.parse(sys.argv[1:])
|
||||
(opt, flags, extra) = o.parse(sys.argv[2:])
|
||||
|
||||
if opt.daemon:
|
||||
opt.syslog = 1
|
||||
|
7
sshuttle
Executable file
7
sshuttle
Executable file
@ -0,0 +1,7 @@
|
||||
#!/bin/sh
|
||||
DIR=$(dirname "$0")
|
||||
if python2 -V 2>/dev/null; then
|
||||
exec python2 "$DIR/main.py" python2 "$@"
|
||||
else
|
||||
exec python "$DIR/main.py" python "$@"
|
||||
fi
|
@ -1,4 +1,4 @@
|
||||
#!/usr/bin/python
|
||||
#!/usr/bin/env python
|
||||
import sys, os, socket, select, struct, time
|
||||
|
||||
listener = socket.socket()
|
||||
|
Loading…
Reference in New Issue
Block a user