Recommended Posts

Good morning, evening, afternoon, or night to all.

I'm having some issues with a shell script. Each line works individually in terminal, but when run from a .sh they fail.

Hopefully someone can tell me what I borked. (Staples is the USB key I'm using, sleep is in there for troubleshooting)

I am absolutely terrible at scripting, but I have to do this across approximately 100 macs across the enterprise so ARD is my only choice, and I dont feel like doing it one by one. I have looked far and wide, and can find nothing about HDIUTIL giving errors when run in terminal (specifically no such file or directory)

If I mount the dmg myself through terminal, the script then gives a "Unexpected E0F while looking for matching '"')

 

hdiutil mount /Volumes/staples/mac/Image/fcc12110.dmg
sleep 5
sudo installer -package /Volumes/FirstClassClient12110.pkg/FirstClassClient12110.pkg -target "/Volumes/Macintosh HD"
sleep 10
cd ~
hdiutil unmount "/Volumes/FirstClassClient12110.pkg/" 
sleep 10
networksetup -setairportnetwork en1 SFS_WIFI BLANKBLANKBLANK
networksetup -setairportpower en1 off

lpadmin -p HP_LaserJet_3015 -D "RM162 - BW" -L "AD Art" -E -v socket://ourlovelyprintserver/RM162-BW -P "/Library/Printers/PPDs/Contents/Resources/HP 

Laserjet 3015.gz"

 

 

 

Thank you!

Link to comment
Share on other sites

Turns out I had to write it into an applescript with the do shell script tag. 

Link to comment
Share on other sites

This topic is now closed to further replies.