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 } |