#!/bin/sh
if [ -f /run/enigma2/system-state ]; then
	state=`cat /run/enigma2/system-state`
	case "$state" in
		"system-restart")
			systemctl --no-block reboot
			;;
		"system-standby")
			systemctl --no-block poweroff
			;;
		"ui-restart")
			;;
	esac
	rm -f /run/enigma2/system-state
fi
