Ubuntu Pastebin

Paste from bashrc at Fri, 18 Sep 2015 09:45:58 +0000

Download as text
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
function sshl(){

	if [ `[ ! -z $2 ]` -a `[ -z $3 ]` ]; then
		port1=`echo $1 | cut -d':' -f 1`
		port2=`echo $1 | cut -d':' -f 2`
		if [ -z ${port2} ]; then
			port2=${port1}
		fi
		ssh -L 0.0.0.0:${port1}:$2:${port2} $2
	else
		echo "usage: l2s ip"
	fi

}
Download as text