#!/bin/sh
+#
+# $HeadURL$
+# $LastChangedRevision$
+# $LastChangedDate$
+# $LastChangedBy$
+#
+
+usage() {
+ echo "$0 [hostname] [optional_command]"
+ echo ""
+ echo "Connects to a remote system and runs 'ksu' to root"
+ echo "Runs optional_command if specified, otherwise, launches a shell"
+ echo ""
+}
+
+if [ $# -eq 0 ]; then
+ echo "Error - no host specified!"
+ usage
+ exit 1
+fi
execargs=''
ADMINPATH=/sbin:/usr/sbin:/usr/local/sbin:/bin:/usr/bin:/usr/local/bin
-if [ -n "$2" ]; then
- execargs="-a -c '$2'"
+
+targethost=$1
+shift
+
+
+if [ -n "$1" ]; then
+ execargs="-a -c '$@'"
fi
-ssh -oForwardX11=no -oForwardX11Trusted=no -oGSSAPIDelegateCredentials=yes -t $1 PATH=$ADMINPATH ksu -z $execargs
+ssh -oForwardX11=no -oForwardX11Trusted=no -oGSSAPIDelegateCredentials=yes -t $targethost PATH=$ADMINPATH ksu -z $execargs
mh-sysadmin-tools (1.1) unstable; urgency=low
- * don't forward X11 when using SSH
+ * Don't forward X11 when using SSH
+ * Pass all arguments to the remote side
+ * Add some documentation
- -- Michael Howe <michael@michaelhowe.org> Sat, 28 Jan 2012 20:22:27 +0000
+ -- Michael Howe <michael@michaelhowe.org> Sat, 28 Jan 2012 21:20:22 +0000
mh-sysadmin-tools (1.0) unstable; urgency=low