added client shell

This commit is contained in:
Paolo Asperti 2019-05-09 17:37:28 +02:00
parent 83bf64bd39
commit 4d7087e7ca
Signed by: paspo
GPG Key ID: 06D46905D19D5182

16
root/usr/bin/client-shell Normal file
View File

@ -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}