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-standby < prev    next >
Text File  |  2006-11-29  |  816b  |  23 lines

  1. #!/bin/sh
  2.  
  3. PRIVILEGE=hal-power-standby
  4. if [ "$HAL_METHOD_INVOKED_BY_UID" != "0" ] ; then
  5.     RESULT=$(polkit-is-privileged --privilege $PRIVILEGE \
  6.                                   --user $HAL_METHOD_INVOKED_BY_UID \
  7.                               --system-bus-unique-name $HAL_METHOD_INVOKED_BY_SYSTEMBUS_CONNECTION_NAME 2>&1)
  8.     IS_PRIVILEGED=$?
  9.     if [ "$IS_PRIVILEGED" != "0" ] ; then
  10.     echo org.freedesktop.Hal.Device.PermissionDeniedByPolicy >&2
  11.     echo $PRIVILEGE refused uid $HAL_METHOD_INVOKED_BY_UID >&2
  12.     exit 1
  13.     fi
  14. fi
  15.  
  16. if [ -n "$HALD_UNAME_S" -a -x ./$HALD_UNAME_S/hal-system-power-standby-$HALD_UNAME_S ]; then
  17.     exec ./$HALD_UNAME_S/hal-system-power-standby-$HALD_UNAME_S $@
  18. else
  19.     echo "org.freedesktop.Hal.Device.UnknownError" >&2
  20.     echo "No back-end for your operating system" >&2
  21.     exit 1
  22. fi
  23.