#!/bin/bash
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
export PATH
trap 'echo HUP' SIGHUP
trap 'echo HUP' SIGTERM

if [ ! -f /opt/euro-beta/systools/distr/euro3g_standalone_system ]
then
  exit 0
fi

{
if [ -f /opt/euro-beta/full_restart ]
then
  rm -f /opt/euro-beta/full_restart
  reboot
elif [ -e /bin/systemctl ]
then	
  touch /opt/euro-beta/quick_restart
  echo 'systemctl restart euro3g' | at now
  systemctl restart euro3g 
else
  service euro3g stop
  sleep 2
  touch /opt/euro-beta/quick_restart
  service euro3g start

fi
} > /tmp/e3g_restart.log 2>&1

