cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
gwesterfieldjr
Level 3

Executing sudo commands on Mac OSX from shell script

Hello,

I'm creating an installer for Mac OS X and I'm having huge issues trying to execute sudo commands. I have the installer checked for "Requires an Administrator Name and Password to Install" but the installer is still failing to execute sudo commands from a bash script that i create in a custom code action and deploy to be executed. The bash script has looks like this ....

#!/bin/bash

#Install XCode Command Line Utilities
cd "/usr/local/bin/AppWrapping/XCode"
hdiutil mount xcode452cltools10_86938211a.dmg
sudo installer -pkg "/Volumes/Command Line Tools (Mountain Lion)/Command Line Tools (Mountain Lion).mpkg" -target /
hdiutil eject "/Volumes/Command Line Tools (Mountain Lion)"

The script is running and mounting the dmg file. then when it trys to run the sudo installer -pkg line i get this error "no tty present and no askpass program specified"

please help...
Labels (1)
0 Kudos
(1) Reply
pv7721
Level 20

I think your issue is similare with this one: http://community.flexerasoftware.com/showthread.php?206867-execute-sudo-commands-from-shell-script
Just the message is different, as you're on MAC OS X...
0 Kudos