File: hal-system-power-reboot-linux

package info (click to toggle)
hal 0.5.14-3
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 10,212 kB
  • ctags: 4,854
  • sloc: ansic: 60,732; xml: 16,387; sh: 11,366; makefile: 1,111; cpp: 292
file content (18 lines) | stat: -rwxr-xr-x 333 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/bin/sh

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

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