diff --git a/setup.sh b/setup.sh index e37d764..8309879 100644 --- a/setup.sh +++ b/setup.sh @@ -1,5 +1,5 @@ #!/bin/bash -[[ $(uname) = "Linux" ]] || grep "sshin" ~/.bashrc >/dev/null || echo "alias sshin=\"~/sshin/sshin\"" >> ~/.bashrc; echo "run \"source ~/.bashrc\"";exit +[[ $(uname) = "Linux" ]] && grep "sshin" ~/.bashrc >/dev/null || echo "alias sshin=\"~/gitclones/sshin/sshin\"" >> ~/.bashrc; echo "run \"source ~/.bashrc\"";exit PREFIX=~/.local/ mkdir $PREFIX/share/sshin diff --git a/sshin b/sshin index 58539ca..5a1739c 100755 --- a/sshin +++ b/sshin @@ -21,9 +21,11 @@ then command="${command}192.168.1.$1" else [[ $(uname) = "Linux" ]] && ports_file="$HOME/.local/share/sshin/port_association" || ports_file="$HOME/sshin/port_association" - port=$(grep $1 $ports_file | awk '{print $NF}') + port=$(grep $1 $ports_file | awk '{print $2}') command="${command}$1" [[ -n $port ]] && command="${command} -p $port" + dport=$(grep $1 $ports_file | awk '{print $NF}') + [[ -n $port ]] && command="${command} -D$dport" fi echo $command $command