From 77501543d0f9aa94dcc9a814f420c43e07f09611 Mon Sep 17 00:00:00 2001 From: tv Date: Tue, 29 Jan 2013 16:42:41 +0100 Subject: //services/bin/services: initial commit --- services/bin/services | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100755 services/bin/services (limited to 'services/bin') 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 -- cgit v1.2.3 From 2da96a69e9ab02db32cdafd194ef3e5f87ca71dc Mon Sep 17 00:00:00 2001 From: tv Date: Tue, 29 Jan 2013 17:00:43 +0100 Subject: //services services: use $services_identity_file --- services/bin/services | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'services/bin') diff --git a/services/bin/services b/services/bin/services index 90d3f624..c142a363 100755 --- a/services/bin/services +++ b/services/bin/services @@ -1,11 +1,17 @@ #! /bin/sh # usage: services [user@]hostname[:port] +# environment: +# services_identity_file path to ssh(1) identity_file set -euf user=services hostname=${1-localhost} port=1337 +if test -n "${services_identity_file-}"; then + options="${options+$options }-i $services_identity_file" +fi + if echo $hostname | grep -q @; then user=`echo $hostname | cut -d@ -f1` hostname=`echo $hostname | cut -d@ -f2` @@ -15,4 +21,4 @@ if echo $hostname | grep -q :; then hostname=`echo $hostname | cut -d: -f1` fi -ssh $user@$hostname -p $port +ssh $options $user@$hostname -p $port -- cgit v1.2.3