mirror of
https://github.com/joshuaboniface/rffmpeg.git
synced 2026-07-18 00:45:53 +00:00
Enabled SSH multiplexing/persistence
This commit is contained in:
parent
3945e1c514
commit
338d8e7d27
2 changed files with 15 additions and 8 deletions
20
rffmpeg.py
20
rffmpeg.py
|
|
@ -73,6 +73,7 @@ try:
|
|||
"logfile": o_config["rffmpeg"]["logging"]["logfile"],
|
||||
"remote_hosts": o_config["rffmpeg"]["remote"]["hosts"],
|
||||
"remote_user": o_config["rffmpeg"]["remote"]["user"],
|
||||
"remote_persist": o_config["rffmpeg"]["remote"]["persist"],
|
||||
"remote_args": o_config["rffmpeg"]["remote"]["args"],
|
||||
"pre_commands": o_config["rffmpeg"]["commands"]["pre"],
|
||||
"ffmpeg_command": o_config["rffmpeg"]["commands"]["ffmpeg"],
|
||||
|
|
@ -213,14 +214,17 @@ def setup_remote_command(target_host):
|
|||
rffmpeg_ssh_command.append("-q")
|
||||
|
||||
# Set our connection timeouts, in case one of several remote machines is offline
|
||||
rffmpeg_ssh_command.append("-o")
|
||||
rffmpeg_ssh_command.append("ConnectTimeout=1")
|
||||
rffmpeg_ssh_command.append("-o")
|
||||
rffmpeg_ssh_command.append("ConnectionAttempts=1")
|
||||
rffmpeg_ssh_command.append("-o")
|
||||
rffmpeg_ssh_command.append("StrictHostKeyChecking=no")
|
||||
rffmpeg_ssh_command.append("-o")
|
||||
rffmpeg_ssh_command.append("UserKnownHostsFile=/dev/null")
|
||||
rffmpeg_ssh_command.extend([ "-o", "ConnectTimeout=1" ])
|
||||
rffmpeg_ssh_command.extend([ "-o", "ConnectionAttempts=1" ])
|
||||
rffmpeg_ssh_command.extend([ "-o", "StrictHostKeyChecking=no" ])
|
||||
rffmpeg_ssh_command.extend([ "-o", "UserKnownHostsFile=/dev/null" ])
|
||||
|
||||
# Use SSH control persistence to keep sessions alive for subsequent commands
|
||||
persist = config["remote_persist"]
|
||||
if persist > 0:
|
||||
rffmpeg_ssh_command.extend([ "-o", "ControlMaster=auto" ])
|
||||
rffmpeg_ssh_command.extend([ "-o", "ControlPath=/tmp/persist-%r@%h:%p" ])
|
||||
rffmpeg_ssh_command.extend([ "-o", "ControlPersist={}".format(persist) ])
|
||||
|
||||
for arg in config["remote_args"]:
|
||||
if arg:
|
||||
|
|
|
|||
|
|
@ -34,6 +34,9 @@ rffmpeg:
|
|||
# The remote SSH user to connect as
|
||||
user: jellyfin
|
||||
|
||||
# How long to persist SSH sessions (0 to disable)
|
||||
persist: 120
|
||||
|
||||
# A YAML list of additional SSH arguments (e.g. private keys),
|
||||
# one line per space-separated argument element.
|
||||
args:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue