#directory #remote #run #command #ssh #was #utility

bin+lib rrun-ssh

Remote run utility; runs a command via SSH if the current directory was mounted via SSHFS

1 unstable release

Uses old Rust 2015

0.3.0 Sep 3, 2016

#66 in #was

Custom license

17KB
379 lines

rrun

Remote run utility; runs a command via SSH if the current directory was mounted via SSHFS. You may freely use and modify this code under the CC0 1.0 Universal License.

Usage

Run command remotely:

rrun [COMMAND [ARGS...]]

Get currently mounted host and directory:

rpwd

For more formal documentation, you can find the rustdoc here.

Installation

Requires Rust 1.9 to build. Install with:

cargo build --release
install -m755 target/release/rrun /usr/bin/rrun
install -m755 target/release/rpwd /usr/bin/rpwd

lib.rs:

The command-line tool works in the following order:

  1. RemoteMounts::load is called to load the contents of /etc/mtab into an internal struct.
  2. RemoteMounts::into_current_dir is called to convert the above into a Location.
  3. Location::into_env_args is called to convert the above into ProgramArgs.
  4. ProgramArgs::into_command is called to convert the above into std::process::Command.

For rpwd, only steps 1 and 2 are run, and the resulting Location is printed.

No runtime deps