#!/bin/sh
# 2010-02-04 erjo@slitaz.org
# * Use reboot first for Busybox.

unsupported() {
	echo "org.freedesktop.Hal.Device.SystemPowerManagement.NotSupported" >&2
	echo "No reboot command found" >&2
	exit 1
}

#Try for common tools
if [ -x "/sbin/reboot" ] ; then
	/sbin/reboot
	exit $?
elif [ -x "/sbin/shutdown" ] ; then
	/sbin/shutdown -r now
	exit $?
elif [ -x "/usr/sbin/shutdown" ] ; then
	/usr/sbin/shutdown -r now
	exit $?
else
	unsupported
fi
