I have a script that runs successfully from the command line. I have a launchdaemon that loads the script from the command line and it runs successfully, whether I load from command line or when I restart the machine. When I restart my machine and let the launchd run as intended, the Console reads the DSCL record, but when I start up WorkGroup manager, the record is not there.

Can anyone see what might be wrong? What I'm missing?



Script:
*************
#!/bin/sh

/usr/sbin/ipconfig waitall

macAddress=`/sbin/ifconfig en0 | /usr/bin/grep 'ether' | /usr/bin/sed "s/^[[:space:]]ether //" | cut -f1 -d " "`

echo "$macAddress"

/usr/bin/dscl . -create /Computers/Desktop ENetAddress $macAddress

/usr/bin/dscl . -read /Computers/Desktop

LaunchD:
********

{code}
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>sh.attrsetup</string>
<key>Program</key>
<string>/Library/Scripts/Custom/attrsetup.sh</string>
<key>RunAtLoad</key>
<true/>
</dict>
</plist>
{/code}



Console log after reboot:
*********
5/17/10 10:48:09 AM com.apple.launchd[1] *** launchd[1] has started up. ***
5/17/10 10:48:23 AM sh.attrsetup[49] 00:1f:5b:ea:90:89
5/17/10 10:48:23 AM sh.attrsetup[49] AppleMetaNodeLocation: /Local/Default
5/17/10 10:48:23 AM sh.attrsetup[49] ENetAddress: 00:1f:5b:ea:90:89
5/17/10 10:48:23 AM sh.attrsetup[49] GeneratedUID: CAB6BCA7-DCED-4779-804C-E1C11AB253A7
5/17/10 10:48:23 AM sh.attrsetup[49] RecordName: Desktop
5/17/10 10:48:23 AM sh.attrsetup[49] RecordType: dsRecTypeStandard:Computers