home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 2007 January, February, March & April
/
Chip-Cover-CD-2007-02.iso
/
boot
/
i386
/
rescue
/
usr
/
lib
/
hal
/
scripts
/
hal-system-power-hibernate
< prev
next >
Wrap
Text File
|
2006-11-29
|
818b
|
25 lines
#!/bin/sh
PRIVILEGE=hal-power-hibernate
if [ "$HAVE_POLKIT" == "1" ] ; then
if [ "$HAL_METHOD_INVOKED_BY_UID" != "0" ] ; then
RESULT=$(polkit-is-privileged --privilege $PRIVILEGE \
--user $HAL_METHOD_INVOKED_BY_UID \
--system-bus-unique-name $HAL_METHOD_INVOKED_BY_SYSTEMBUS_CONNECTION_NAME 2>&1)
IS_PRIVILEGED=$?
if [ "$IS_PRIVILEGED" != "0" ] ; then
echo org.freedesktop.Hal.Device.PermissionDeniedByPolicy >&2
echo $PRIVILEGE refused uid $HAL_METHOD_INVOKED_BY_UID >&2
exit 1
fi
fi
fi
if [ -n "$HALD_UNAME_S" -a -x ./$HALD_UNAME_S/hal-system-power-hibernate-$HALD_UNAME_S ]; then
exec ./$HALD_UNAME_S/hal-system-power-hibernate-$HALD_UNAME_S $@
else
echo "org.freedesktop.Hal.Device.UnknownError" >&2
echo "No back-end for your operating system" >&2
exit 1
fi