Thank you for your answer. I have searched a little bit on following way:
On the server run a script to verify if the rooter IP is responding to ping. If no response to ping probably the rooter is down because of the power down. If so run a clean shutdown.
Now all I have to search for is the syntax for this script
Thank you again!
Gabi
if ping -c 3 <rooter IP> & ping -c 3 yahoo.com
then
// do nothing
else
poweroff now
fi