Skip to main content
Question

scripting...

  • May 22, 2009
  • 0 replies
  • 9 views

Forum|alt.badge.img+6

Hi, I'm trying to get my script (which works locally) to deploy over Casper
and it's not. I'm trying to determine whether there are certain
directories present and, if there are, run a command to install an item
into the dock. I have used the built-in parameter substitution and I've
tried it without. In most cases, the script appears to run but does
nothing. This is a sample of the variations I've tried thus far.

# Application variables
computerName=$2
someapp1=$2/Applications/Something I Need To Deploy
someapp2="$2/Applications/Something"
someapp3="$computerName/Applications/Something"

Here is the actual script.

#!/bin/sh

# Applications
kid_pix="/Applications/Kid Pix Deluxe 4"
ttl="/Applications/Type To Learn 3"
kidspiration="/Applications/Kidspiration 2" inspiration="/Applications/Inspiration 8"

if [ -e $kid_pix ]; then
defaults write com.apple.dock persistent-apps -array-add
"<dict><key>tile-data</key><dict><key>file-data</key><dict><key>_CFURLString</key><string>/Applications/Kid
Pix Deluxe 4/Kid Pix Deluxe
4/</string><key>_CFURLStringType</key><integer>0</integer></dict></dict></dict>"
fi

if [ -e $kidspiration ]; then
defaults write com.apple.dock persistent-apps -array-add
"<dict><key>tile-data</key><dict><key>file-data</key><dict><key>_CFURLString</key><string>/Applications/Kidspiration
2/Kidspiration
2.app/</string><key>_CFURLStringType</key><integer>0</integer></dict></dict></dict>"
fi

if [ -e $inspiration ]; then
defaults write com.apple.dock persistent-apps -array-add
"<dict><key>tile-data</key><dict><key>file-data</key><dict><key>_CFURLString</key><string>/Applications/Inspiration
8/Inspiration
8.app/</string><key>_CFURLStringType</key><integer>0</integer></dict></dict></dict>"
fi

if [ -e $ttl ]; then
defaults write com.apple.dock persistent-apps -array-add
"<dict><key>tile-data</key><dict><key>file-data</key><dict><key>_CFURLString</key><string>/Applications/Type
To Learn 3/Type To Learn
3/</string><key>_CFURLStringType</key><integer>0</integer></dict></dict></dict>"
fi

killall Dock

exit 0

John McLaughlin
Technical Support Specialist
Newton Public Schools