12 lines
		
	
	
		
			248 B
		
	
	
	
		
			Bash
		
	
	
		
			Executable File
		
	
	
	
	
			
		
		
	
	
			12 lines
		
	
	
		
			248 B
		
	
	
	
		
			Bash
		
	
	
		
			Executable File
		
	
	
	
	
#!/bin/sh
 | 
						|
 | 
						|
# A name for the session
 | 
						|
session_name="$(whoami)_sess"
 | 
						|
 | 
						|
if [ ! -z $1 ]; then
 | 
						|
	ssh -t "$1" "tmux attach -t $session_name || DISPLAY=:0 tmux new -s $session_name"
 | 
						|
else
 | 
						|
	echo "Usage: sshtmux HOSTNAME"
 | 
						|
	echo "You must specify a hostname"
 | 
						|
fi
 |