made makefile

This commit is contained in:
Marco Raber 2022-04-27 20:08:16 +02:00
parent 76a35b8301
commit 6712ebfae9
2 changed files with 4 additions and 2 deletions

View File

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

4
sshin
View File

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