remote ip

This commit is contained in:
guillaume
2024-03-30 11:24:49 +01:00
parent 44e406c80f
commit c4801fa8dc
4 changed files with 6 additions and 14 deletions
@@ -18,17 +18,17 @@ if [[ $(id -u) != "0" ]]
Exit root
fi
[[ -z $(ifconfig | grep inet | awk '{print $2}' | grep $LocalIp) ]] && Exit Config
[[ -z $(ifconfig | grep inet | awk '{print $2}' | grep $RemoteIp) ]] && Exit Config
[[ "${Crypted}" == "yes" ]] && NcCmd="cryptcat -k ${LocalPassword} -l ${LocalIp} -p ${LocalPort} " || NcCmd="nc -l ${LocalIp} ${LocalPort}"
[[ "${Crypted}" == "yes" ]] && NcCmd="cryptcat -k ${LocalPassword} -l ${RemoteIp} -p ${LocalPort} " || NcCmd="nc -l ${RemoteIp} -p ${LocalPort}"
if [[ "${1}" == "start" ]]
then
while true
do
#coproc cryptcat -k ${LocalPassword} -l ${LocalIp} -p ${LocalPort}
#coproc cryptcat -k ${LocalPassword} -l ${RemoteIp} -p ${LocalPort}
coproc eval ${NcCmd}
while read -r cmd; do
logger "Running $cmd"