]> arthur.barton.de Git - bup.git/blobdiff - cmd/on--server-cmd.py
web: for unix://path, listen on filesystem socket
[bup.git] / cmd / on--server-cmd.py
index 3d2af568bc58335afdb88c99e50caec84c9f255b..cdfd44113c352e3560a521e97d7e915344b7ee07 100755 (executable)
@@ -1,4 +1,9 @@
-#!/usr/bin/env python
+#!/bin/sh
+"""": # -*-python-*-
+bup_python="$(dirname "$0")/bup-python" || exit $?
+exec "$bup_python" "$0" ${1+"$@"}
+"""
+# end of bup preamble
 import sys, os, struct
 from bup import options, helpers
 
@@ -7,7 +12,7 @@ bup on--server
 --
     This command is run automatically by 'bup on'
 """
-o = options.Options('bup server-reverse', optspec)
+o = options.Options(optspec)
 (opt, flags, extra) = o.parse(sys.argv[1:])
 if extra:
     o.fatal('no arguments expected')
@@ -23,6 +28,7 @@ assert(sz < 1000000)
 buf = sys.stdin.read(sz)
 assert(len(buf) == sz)
 argv = buf.split('\0')
+argv = [argv[0], 'mux', '--'] + argv
 
 # stdin/stdout are supposedly connected to 'bup server' that the caller
 # started for us (often on the other end of an ssh tunnel), so we don't want