]> gitweb.fluxo.info Git - scripts.git/commitdiff
Option to run screen as root at asshs
authorSilvio Rhatto <rhatto@riseup.net>
Sun, 24 Mar 2013 23:39:49 +0000 (20:39 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Sun, 24 Mar 2013 23:39:49 +0000 (20:39 -0300)
assh

diff --git a/assh b/assh
index e3c8ebdf5771d60ce438f8ebc0076b6fa3d9b946..33e2caec45effa7d05454a2386e7c0ae86a2e94e 100755 (executable)
--- a/assh
+++ b/assh
@@ -12,7 +12,11 @@ if [ -z "$DEST" ]; then
 fi
 
 if [ "$BASENAME" == "asshs" ]; then
-  autossh $DEST.`facter domain` -t -- screen -x $COMMAND
+  if [ "$COMMAND" == "root" ]; then
+    autossh $DEST.`facter domain` -t -- sudo screen -x
+  else
+    autossh $DEST.`facter domain` -t -- screen -x $COMMAND
+  fi
 else
   autossh $DEST.`facter domain` -t -- $COMMAND
 fi