]> www.vanbest.org Git - motioneye-debian/commitdiff
always use python meyectl.py for internal commands
authorCalin Crisan <ccrisan@gmail.com>
Mon, 12 Oct 2015 18:40:22 +0000 (21:40 +0300)
committerCalin Crisan <ccrisan@gmail.com>
Mon, 12 Oct 2015 18:40:22 +0000 (21:40 +0300)
motioneye/meyectl.py

index b31a565bd0bd67c75caec9d6243e6c23eef3da05..5ba7f57842a217850f7f20d20af926b4ee959a9c 100755 (executable)
@@ -34,11 +34,8 @@ _LOG_FILE = 'motioneye.log'
 
 
 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 = __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:]