This repository has been archived on 2024-03-28. You can view files and clone it, but cannot push or open issues or pull requests.
dotfiles/bin/remote

12 lines
348 B
Plaintext
Raw Normal View History

#!/usr/bin/env moon
2020-01-28 11:05:17 -06:00
2019-11-12 16:39:31 -06:00
arg_spec = {
{"target", "REMOTE_MACHINE", "remote"}
{"mpr", "MOSH_PORT_RANGE", "60000:61000"}
{"sargs", "SSH_ARGS", "-XY"}
{"margs", "MOSH_ARGS", ""}
}
2020-01-28 11:05:17 -06:00
2019-11-12 16:39:31 -06:00
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}"