I've been having issues for a long time with Mac scripts with the $(KACE_DEPENDECY_DIR) variable. It never seems to work on Macs, but does for Windows. So in order for me to get my scripts to work with dependencies, I have to specify the full path to where the script goes (i.e. /Library/Application\ Support/Dell/KACE/data/kbots_cache/packages/kbots/453).  

Is there a $KACE DEPENDENCY DIR variable for Macs? Do I just have the name/capitalization/syntax wrong?

Answer Summary:
There are many ways to bake a cake; I mean do things in Kace. In this situation, when trying to use a profile file with a unix Command on a MAC we ran into pathing issues; Kace know where $(KACE_DEPENDECY_DIR) but the MAC obviously did not. So despite several attempts to work with $(KACE_DEPENDECY_DIR), we opted to just unzip the profile file into a known location /tmp and point our MAC unix commands to /tmp Success!
0 Comments   [ + ] Show Comments


Please log in to comment

Community Chosen Answer


Ok, sorry to double back again, but let's try this

Answered 04/02/2014 by: Jbr32
Tenth Degree Black Belt


    Thanks! Now I'll have to redo my scripts so they aren't hard coding the path.
    • Glad to hear!
Please log in to comment



$KACE_DEPENDENCY_DIR should work in a Mac script. What version of the K1000 do you have installed?

Answered 04/01/2014 by: jknox
Red Belt

  • We use it all the time, works like a charm
    • I must be doing something wrong then. Here's a script I'm working on that removes our staff/faculty Macs from student-access and older employee-access configs that don't work anymore because the certificate expired.

      This is for OSX 10.6 and under.

      employee-access-profile.1 is a dependency.

      On Success
      Launch "/usr/sbin\networksetup" with params "-setairportpower en1 off".
      Launch "/usr/sbin\networksetup" with params "-removepreferredwirelessnetwork en1 employee-access".
      Launch "/usr/sbin\networksetup" with params " -removepreferredwirelessnetwork en1 student-access".
      Launch "/usr/sbin\networksetup" with params "-deletesystemprofile AirPort ".
      Launch "/usr/sbin\networksetup" with params "-import8021xProfiles AirPort $KACE_DEPENDENCY_DIR/employee-access-profile.1".
      Launch "/usr/sbin\networksetup" with params "-setairportpower en1 on".

      The 2nd to last line with $KACE_DEPENDENCY_DIR does not work. However if I replace that with the full path /Library/Application\ Support/Dell/KACE/data/kbots_cache/packages/kbots/453 it does work.
Please log in to comment

jtremblay - does your script look like the image below?

Answered 04/02/2014 by: Jbr32
Tenth Degree Black Belt

  • No, I'm using Directory: /usr/bin then File (unix command) and I'm trying to put $(KACE_DEPENDENCY_DIR) as a variable in Target. Is that incorrect? How should I call unix commands?

    Also, I can't figure out how to post an image like you did.
    • If you post an answer you can upload an image. Give that a shot so I can see what you are talking about.
    • Is it possible that the $(KACE_DEPENDENCY_DIR) is a relative path vs absolute?
Please log in to comment

Answered 04/02/2014 by: jtremblay
Purple Belt

  • I just did a quick test and it appears that $(KACE_DEPENDENCY_DIR) is a full path, but it does include spaces. Perhaps try "$(KACE_DEPENDENCY_DIR)"
    • I tried replacing the full path as above with:

      -import8021xProfiles AirPort $(KACE_DEPENDENCY_DIR)/employee-access-profile.1

      And it doesn't work.

      I also tried the same but with no / after $(KACE_DEPENDENCY_DIR) which also didn't work.
      • I think this might be one of those cases where I would get creative with my deployment.

        Here is what I would try, add an additional dependency called moveThis.sh

        Just prior to your import command, execute moveThis.sh which basically just contains the following:
        mv $(KACE_DEPENDENCY_DIR)/employee-access-profile.1 /tmp/

        Then run your import command but change the path to reflect the new location of your employee-access-profile.1 file as /tmp
Please log in to comment

So here's the revised script. 

employee-access-profile.zip contains employe-access-profile.1 and movethis.sh, which is chmod'ed +x and contains "mv $(KACE_DEPENDENCY_DIR)/employee-access-profile.1 /tmp"


This script still doesn't work. On my test machine, I opened a terminal, went to the script dir, and executed:


But I just get command not found.

If I remove the ('s it works. So I take it OSX doesn't like ('s in a variable name.

However, even when I remove the the ('s and sudo sh movethis.sh, it still doesn't work. It's not passing the variable.

Answered 04/02/2014 by: jtremblay
Purple Belt

  • For the screenshot above, I do not see under dependencies the moveThis.sh file (I was just making up a file name).
    • It's in the zip file
      • Does your employee-acces-profile.1 file end up in /tmp ?
    • No, employee-access-profile.1 doesn't get moved.
      • Can you post the contents of the moveThis.sh script you created. It sounds like there might be an error in there.
    • This content is currently hidden from public view.
      Reason: Removed by member request
      For more information, visit our FAQ's.
    • movethis.sh:
      mv $KACE_DEPENDENCY_DIR/employee-access-profile.1 /tmp

      I tried it with and without ('s. It's looking to me like the variable only works on the K1000 server side, not on the client end.
      • Try this:

        mv employee-access-profile.1 /tmp
    • I changed it to: mv employee-access-profile.1 /tmp

      However the profile doesn't get moved. Can't tell if the movethis.sh is not running or if it errors out. If I manually run it from the terminal on the target it does move.
Please log in to comment
Answer this question or Comment on this question for clarity