Commit a62975e0 authored by Avery Pennarun's avatar Avery Pennarun

client: workaround for idiotic ArchLinux renaming of python to python2.

First try running under python2, then python if that doesn't exist.
parent 4fde980f
...@@ -102,7 +102,7 @@ class FirewallClient: ...@@ -102,7 +102,7 @@ class FirewallClient:
self.subnets_include = subnets_include self.subnets_include = subnets_include
self.subnets_exclude = subnets_exclude self.subnets_exclude = subnets_exclude
self.dnsport = dnsport self.dnsport = dnsport
argvbase = ([sys.argv[0]] + argvbase = ([sys.argv[1], sys.argv[0], sys.argv[1]] +
['-v'] * (helpers.verbose or 0) + ['-v'] * (helpers.verbose or 0) +
['--firewall', str(port), str(dnsport)]) ['--firewall', str(port), str(dnsport)])
if ssyslog._p: if ssyslog._p:
......
#!/usr/bin/env python
import sys, os, re import sys, os, re
import helpers, options, client, server, firewall, hostwatch import helpers, options, client, server, firewall, hostwatch
import compat.ssubprocess as ssubprocess import compat.ssubprocess as ssubprocess
...@@ -71,7 +70,7 @@ firewall (internal use only) ...@@ -71,7 +70,7 @@ firewall (internal use only)
hostwatch (internal use only) hostwatch (internal use only)
""" """
o = options.Options(optspec) o = options.Options(optspec)
(opt, flags, extra) = o.parse(sys.argv[1:]) (opt, flags, extra) = o.parse(sys.argv[2:])
if opt.daemon: if opt.daemon:
opt.syslog = 1 opt.syslog = 1
......
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
#!/usr/bin/python #!/usr/bin/env python
import sys, os, socket, select, struct, time import sys, os, socket, select, struct, time
listener = socket.socket() listener = socket.socket()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment