#!/bin/bash
MAXTRY=8 #anzahl versuche anpassen falls gewünscht
WAITTIME=15m # Wartezeit zwischen den versuchen (m für Minuten) anpassen falls gewünscht
WAIT=60
try=0
log=/var/log/ipc/OScam.log #log pfad von oscam anpasse
while [ $try -lt $MAXTRY ]
do
lines=`wc -l $log | cut -f1 -d" "`
sleep $WAIT
linesnew=`wc -l $log | cut -f1 -d" "`
if [ $lines -eq $linesnew ]
then
echo no user conected start reboot
reboot
exit
else
(( try += 1 ))
echo $try: user connected wait and try again
sleep $WAITTIME
fi
done
echo no reboot users still connected