diff options
author | tv <tv@nomic.retiolum> | 2013-01-29 16:42:41 +0100 |
---|---|---|
committer | tv <tv@nomic.retiolum> | 2013-01-29 16:42:41 +0100 |
commit | 77501543d0f9aa94dcc9a814f420c43e07f09611 (patch) | |
tree | 0339b3835364376bbd2b09cf34980195bc5995fc /services/bin/services | |
parent | 60f353a64ac890c35a327c9c2cbcbe0b7b2bc87c (diff) |
//services/bin/services: initial commit
Diffstat (limited to 'services/bin/services')
-rwxr-xr-x | services/bin/services | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/services/bin/services b/services/bin/services new file mode 100755 index 00000000..90d3f624 --- /dev/null +++ b/services/bin/services @@ -0,0 +1,18 @@ +#! /bin/sh +# usage: services [user@]hostname[:port] +set -euf + +user=services +hostname=${1-localhost} +port=1337 + +if echo $hostname | grep -q @; then + user=`echo $hostname | cut -d@ -f1` + hostname=`echo $hostname | cut -d@ -f2` +fi +if echo $hostname | grep -q :; then + port=`echo $hostname | cut -d: -f2` + hostname=`echo $hostname | cut -d: -f1` +fi + +ssh $user@$hostname -p $port |