-
Notifications
You must be signed in to change notification settings - Fork 422
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #284 from rummik/mosh-client-strategy
Add mosh-client default strategy
- Loading branch information
Showing
3 changed files
with
34 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/usr/bin/env bash | ||
|
||
# "mosh-client default strategy" | ||
# | ||
# Example mosh-client process: | ||
# mosh-client -# charm tmux at | 198.199.104.142 60001 | ||
# | ||
# When executed, the above will fail. This strategy handles that. | ||
|
||
ORIGINAL_COMMAND="$1" | ||
DIRECTORY="$2" | ||
|
||
mosh_command() { | ||
local args="$ORIGINAL_COMMAND" | ||
|
||
args="${args#*-#}" | ||
args="${args%|*}" | ||
|
||
echo "mosh $args" | ||
} | ||
|
||
main() { | ||
echo "$(mosh_command)" | ||
} | ||
main |