Add nice whitespace to remote script

This commit is contained in:
Daniel Flanagan 2020-01-28 11:05:17 -06:00
parent 8b34cac915
commit 4fe01b54bb
Signed by: lytedev
GPG key ID: 5B2020A0F9921EF4

View file

@ -1,9 +1,11 @@
#!/usr/bin/env moon #!/usr/bin/env moon
arg_spec = { arg_spec = {
{"target", "REMOTE_MACHINE", "remote"} {"target", "REMOTE_MACHINE", "remote"}
{"mpr", "MOSH_PORT_RANGE", "60000:61000"} {"mpr", "MOSH_PORT_RANGE", "60000:61000"}
{"sargs", "SSH_ARGS", "-XY"} {"sargs", "SSH_ARGS", "-XY"}
{"margs", "MOSH_ARGS", ""} {"margs", "MOSH_ARGS", ""}
} }
args = {v[1], os.getenv(v[2]) or arg[i] or v[3] for i, v in ipairs(arg_spec)} args = {v[1], os.getenv(v[2]) or arg[i] or v[3] for i, v in ipairs(arg_spec)}
os.execute "mosh -p '#{args.mpr}' '#{args.target}' --ssh='ssh #{args.sargs}' #{args.margs}" os.execute "mosh -p '#{args.mpr}' '#{args.target}' --ssh='ssh #{args.sargs}' #{args.margs}"