summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAvery Pennarun <apenwarr@gmail.com>2011-02-07 00:05:19 -0800
committerAvery Pennarun <apenwarr@gmail.com>2011-02-07 00:18:58 -0800
commita62975e0cebc41e4c4bb83571a83ebd0bf699763 (patch)
tree40a47183db608ae3ed2a150411663b86347ffde7
parent4fde980f46daf9952f95f3c04cf2f12d57eba274 (diff)
client: workaround for idiotic ArchLinux renaming of python to python2.
First try running under python2, then python if that doesn't exist.
-rw-r--r--client.py2
-rw-r--r--[-rwxr-xr-x]main.py3
-rwxr-xr-x[l---------]sshuttle8
-rwxr-xr-xstresstest.py2
4 files changed, 10 insertions, 5 deletions
diff --git a/client.py b/client.py
index fa93c26..0ff5f2b 100644
--- a/client.py
+++ b/client.py
@@ -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:
diff --git a/main.py b/main.py
index 3fe1e53..ef00361 100755..100644
--- a/main.py
+++ b/main.py
@@ -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
diff --git a/sshuttle b/sshuttle
index 11a5d8e..d832198 120000..100755
--- a/sshuttle
+++ b/sshuttle
@@ -1 +1,7 @@
-main.py \ No newline at end of file
+#!/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
diff --git a/stresstest.py b/stresstest.py
index f42df09..dba95ea 100755
--- a/stresstest.py
+++ b/stresstest.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
import sys, os, socket, select, struct, time
listener = socket.socket()