diff options
author | Avery Pennarun <apenwarr@gmail.com> | 2011-02-07 00:05:19 -0800 |
---|---|---|
committer | Avery Pennarun <apenwarr@gmail.com> | 2011-02-07 00:18:58 -0800 |
commit | a62975e0cebc41e4c4bb83571a83ebd0bf699763 (patch) | |
tree | 40a47183db608ae3ed2a150411663b86347ffde7 | |
parent | 4fde980f46daf9952f95f3c04cf2f12d57eba274 (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.py | 2 | ||||
-rw-r--r--[-rwxr-xr-x] | main.py | 3 | ||||
-rwxr-xr-x[l---------] | sshuttle | 8 | ||||
-rwxr-xr-x | stresstest.py | 2 |
4 files changed, 10 insertions, 5 deletions
@@ -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: @@ -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 @@ -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() |