Home Forums Software InstaDMG postflight script and sudo commands

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #380458
    bango
    Participant

    hi
    i have a postflight script that binds to AD and some other cool stuff.. the problem is i have some commands that need to have sudo entered in front of the command- e.g. to enable the AD plugin (place the tick beside AD in Directory Service and add it to the search path.. but doesn’t do it. i have a launch agent that calls this script when the local admin logs in. even if i put the sudo command in front of the commands it doesn’t work. im guessing it misses these commands (with sudo) because it wants a password. ive looked in the /etc/sudoers file – added the local admin account, logged off and still doesn’t perform those commands in the script.
    i should tell you this script and launchagent are bundled into a package. i don’t want to run this script using terminal – i know it works this way but this script/pkg is run by techs and i don’t want them to [sudo sh xxx.sh] in terminal
    any advice would be great. 🙂
    thanks

    #380462
    foilpan
    Participant

    you don’t need to preface the commands with sudo if you require admin authentication to install the package. the postflight will effectively run as root.

    #380526
    knowmad
    Participant

    just to take this one step further… im pretty certain you cannot call sudo from within a script.
    any more accomplished unix guys wish to shed a steadier light on this?

    #380527
    foilpan
    Participant

    right. it’s both interactive and unnecessary in this case.

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.

Comments are closed