default handling on lookup in port_association file
This commit is contained in:
parent
69b343498f
commit
5d2b454f24
2
setup.sh
2
setup.sh
|
@ -1,3 +1,3 @@
|
||||||
mkdir ~/.local/share/sshin
|
mkdir ~/.local/share/sshin
|
||||||
cp port_association ~/.local/share/sshin/
|
[[ -e ~/.local/share/sshin/port_association ]] || cp port_association ~/.local/share/sshin/
|
||||||
cp sshin ~/.local/bin || echo "Error in copying executable to ~/.local/bin" && echo "Run: sudo cp sshin /usr/bin/"
|
cp sshin ~/.local/bin || echo "Error in copying executable to ~/.local/bin" && echo "Run: sudo cp sshin /usr/bin/"
|
||||||
|
|
6
sshin
6
sshin
|
@ -21,7 +21,9 @@ if [[ $1 =~ $re ]]
|
||||||
then
|
then
|
||||||
command="${command}192.168.1.$1"
|
command="${command}192.168.1.$1"
|
||||||
else
|
else
|
||||||
port=$(grep $1 ~/.local/share/sshin/port_association | awk '{print $NF}') && command="${command}$1 -p $port"
|
port=$(grep $1 ~/.local/share/sshin/port_association | awk '{print $NF}')
|
||||||
|
command="${command}$1"
|
||||||
|
[[ -n $port ]] && command="${command} -p $port"
|
||||||
fi
|
fi
|
||||||
#echo $command
|
echo $command
|
||||||
$command
|
$command
|
||||||
|
|
Loading…
Reference in New Issue
Block a user