I have simple bash script:
Code:
#!/bin/bash
if nc -w 3 -z 192.168.15.10 5532 <<< . &> /dev/null
then
echo 'Port is open'
ssh -L 1523:127.0.0.1:1523 -gNnT -p 5532 192.168.15.10 &
fi
exit 0
Script is working, but with xinetd serwice:
Code:
service script
{
disable = no
socket_type = stream
protocol = tcp
wait = no
user = root
server = /root/script.sh
log_on_success -= HOST
log_on_failure += HOST
instances = 1
}
script after telnet connection is hang up, I see echo characters in telnet console.
How to reset connection in xinetd service after script execution ? exit 0 not working.