Code: Select all
#!/bin/bash
for (( ; ; ))
do
sleep 1
OSCAM=/home/user/card_server/oscam
DPORT=40000
/bin/nc -z 127.0.0.1 ${DPORT}
if [ $? = 0 ]; then
echo "OK (${DPORT})"
else
echo "KO (${DPORT})"
killall oscam
${OSCAM}
fi
done