]> www.vanbest.org Git - motioneye-debian/commitdiff
meyectl: minor find_command improvement
authorCalin Crisan <ccrisan@gmail.com>
Sun, 4 Oct 2015 17:36:06 +0000 (20:36 +0300)
committerCalin Crisan <ccrisan@gmail.com>
Sun, 4 Oct 2015 17:36:06 +0000 (20:36 +0300)
motioneye/meyectl.py

index af51366528c9e007b8b009a0ce38022a939ec71a..b31a565bd0bd67c75caec9d6243e6c23eef3da05 100755 (executable)
@@ -37,6 +37,8 @@ def find_command(command):
     cmd = sys.argv[0]
     if not cmd.startswith('/'):
         cmd = os.path.join(os.getcwd(), cmd)
+    if cmd.count('meyectl.py'): # prepend the python command if ran with py(c) file
+        cmd = sys.executable + ' ' + cmd
     cmd = cmd.replace('-b', '') # remove server-specific options
     cmd += ' %s ' % command
     cmd += ' '.join([pipes.quote(arg) for arg in sys.argv[2:]