3 # hal-functions.sh: This file contains functions to be used by most or all
5 # hal-system-lcd-get-brightness.sh
7 # Licensed under the Academic Free License version 2.1
11 if [ "$HAVE_POLKIT" = "1" -a -n $HAL_METHOD_INVOKED_BY_SYSTEMBUS_CONNECTION_NAME ]; then
13 PK_RESULT
=`hal-is-caller-privileged --udi $UDI --action $ACTION \
14 --caller $HAL_METHOD_INVOKED_BY_SYSTEMBUS_CONNECTION_NAME`
16 if [ "$RET" != "0" ]; then
17 echo "org.freedesktop.Hal.Device.Error" >&2
18 echo "Cannot determine if caller is privileged" >&2
21 if [ "$PK_RESULT" != "yes" ] ;then
22 echo "org.freedesktop.Hal.Device.PermissionDeniedByPolicy" >&2
23 echo "$ACTION $PK_RESULT <-- (action, result)" >&2
31 if [ -n "$HALD_UNAME_S" -a -x .
/$HALD_UNAME_S/$PROGRAM-$HALD_UNAME_S ]; then
32 .
/$HALD_UNAME_S/$PROGRAM-$HALD_UNAME_S $@
34 echo "org.freedesktop.Hal.Device.UnknownError" >&2
35 echo "No back-end for your operating system" >&2
42 if [ -n "$HALD_UNAME_S" -a -x .
/$HALD_UNAME_S/$PROGRAM-$HALD_UNAME_S ]; then
43 exec .
/$HALD_UNAME_S/$PROGRAM-$HALD_UNAME_S $@
45 echo "org.freedesktop.Hal.Device.UnknownError" >&2
46 echo "No back-end for your operating system" >&2