[PATCH 1/3] WOL: Script to check status and to enable/disable Wake On LAN

David Zeuthen davidz at redhat.com
Tue Aug 28 11:21:42 PDT 2007


On Tue, 2007-08-14 at 15:22 +0200, Holger Macht wrote:
> +wol_supported() {
> +    UDI=$1
> +    
> +    IFACE=`hal-get-property --udi $UDI --key net.interface`
> +    if [ -z "$IFACE" ]; then
> +	echo "org.freedesktop.Hal.Device.WakeOnLAN.NotSupported"
> +	return 1
> +    fi

Actually I think IFACE is the same as HAL_PROP_NET_INTERFACE; saves a
fork + some IPC. Ditto for getting other properties too.

Btw, there should probably exist tools/hal-system-wol-* that looks sorta
like this (this is snipped from another script in tools/) to check
whether the caller is actually privileged to do this

#!/bin/sh
. hal-functions

hal_check_priv org.freedesktop.hal.wol.<the-action>
hal_exec_backend

and you should define these PolicyKit actions in policy/hal-wol.policy

      David




More information about the hal mailing list