Skip to content

Commit

Permalink
screen sessions added
Browse files Browse the repository at this point in the history
  • Loading branch information
c3w committed May 11, 2012
1 parent 599a96e commit cf8a371
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
7 changes: 6 additions & 1 deletion README
@@ -1,6 +1,11 @@
'Ash' v0.1 'Ash' v0.2
http://github.com/c3w/ash http://github.com/c3w/ash


2012MAY10 c3w

added 'screen' option in the ashrc json
. great for wonky networks and ssh tunnels

2011OCT25 c3w 2011OCT25 c3w


TAB host auto-complete added! TAB host auto-complete added!
Expand Down
6 changes: 4 additions & 2 deletions ash
Expand Up @@ -31,16 +31,18 @@ stuff.each do|k,v|
$tunnel_port = "-p #{value} " $tunnel_port = "-p #{value} "
when "tunnel_user" when "tunnel_user"
$tunnel_user = "-l #{value} " $tunnel_user = "-l #{value} "
when "screen"
$screen = "screen -R #{value} "
end end
end end


cmd = "echo 'tell app \"Terminal\" to set current settings of first window to settings set \"#{$type}\"' | osascript" cmd = "echo 'tell app \"Terminal\" to set current settings of first window to settings set \"#{$type}\"' | osascript"
system(cmd) system(cmd)


if $tunnel != "" if $tunnel != ""
cmd = "ssh -A #{$tunnel} #{$tunnel_user} #{$tunnel_port} \"ssh #{$port} -t #{$fqdn} #{$user}\"" cmd = "ssh -A #{$tunnel} #{$tunnel_user} #{$tunnel_port} \"#{$screen} ssh #{$port} -t #{$fqdn} #{$user}\""
else else
cmd = "ssh -A #{$port} #{$user} #{$fqdn}" cmd = "ssh -A #{$port} #{$user} #{$fqdn} -t #{$screen}"
end end
system(cmd) system(cmd)
end end
Expand Down
3 changes: 2 additions & 1 deletion ashrc-dist
Expand Up @@ -13,6 +13,7 @@
"user": "myuser", "user": "myuser",
"tunnel": "www.something.com", "tunnel": "www.something.com",
"tunnel_user": "root", "tunnel_user": "root",
"tunnel_port": "22" "tunnel_port": "22",
"screen": "myscreen"
} }
} }

0 comments on commit cf8a371

Please sign in to comment.