]> git.michaelhowe.org Git - packages/m/mh-sysadmin-tools.git/commitdiff
Added some documentation, better arg processing to rksu
authorMichael Howe <michael@michaelhowe.org>
Sat, 28 Jan 2012 21:30:28 +0000 (21:30 +0000)
committerMichael Howe <michael@michaelhowe.org>
Sat, 28 Jan 2012 21:30:28 +0000 (21:30 +0000)
bin/rksu
debian/changelog

index 79db6f6aa26b4b21dec0dcd756eac6531f17feba..cb571f7bb6c9a41a8af561470b63fa05b71b85f0 100755 (executable)
--- a/bin/rksu
+++ b/bin/rksu
@@ -1,9 +1,34 @@
 #!/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
index 6b12ea7baeba3aff5da9bf76309177c1c9cd84ba..74644a9cbff5f1f7e01d03eea06bf4c570336204 100644 (file)
@@ -1,8 +1,10 @@
 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