From 4d7087e7ca3d79014aaa1b8654acb04ae229d879 Mon Sep 17 00:00:00 2001 From: paspo Date: Thu, 9 May 2019 17:37:28 +0200 Subject: [PATCH] added client shell --- root/usr/bin/client-shell | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 root/usr/bin/client-shell diff --git a/root/usr/bin/client-shell b/root/usr/bin/client-shell new file mode 100644 index 0000000..b493d8b --- /dev/null +++ b/root/usr/bin/client-shell @@ -0,0 +1,16 @@ +#!/bin/sh + +if [ "$1" = "" ] ; then + echo "Usage:" + echo "$0 [hostname]" + exit 1 +fi + +USER=$(db hosts getprop "$1" sshUser) + +if [ "$USER" = "" ] ; then + echo "Can't find an user for $1" + exit 1 +fi + +/usr/bin/sudo -u amgmt /usr/bin/ssh -o StrictHostKeyChecking=no ${USER}\@${1} ${@:2}