• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Environment variable is not read in package postflight script
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Environment variable is not read in package postflight script


  • Subject: Environment variable is not read in package postflight script
  • From: Jeff Vandehey <email@hidden>
  • Date: Tue, 5 Feb 2008 12:16:42 -0800

I have written a small shell script that I use to email the Remote Desktop administrator whenever a macintosh machine is added to our network. Before explaining my problem, I'll explain why this script is necessary. Perhaps some of you have another work around for this. Our enterprise has multiple subnets, across different physical locations. This makes it a challenge to have all OSX hosts added and configured in ARD. I really have no idea when new mac is imaged and deployed. I have written a small shell script, that emails me, whenever a host is imaged and added to our network. This way, I know when a new machine is added, and I can add it to my ARD list. I don't have any problems with the script itself, mail configurations, etc. When I execute the script from the local machine, I receive the email just fine. It reads the $HOST environment variable, and the email that I received is perfect.

When I take this same script, and set it up as a post-flight script on a package, it does NOT read the $HOST variable. I get the email fine, but I get just a blank space where the $HOST variable should list information. Since the package is run as root, the email comes from System Administrator. The script is below. What do I need to add to it, to make it so I can read this environment variable?

Thanks,
Jeff

--Begin Script--
SUBJECT="New Host Added: "
TO="email@hidden"

/usr/bin/mail -s "$SUBJECT $HOST" "$TO" <<EOF
A new host was imaged today at `date`. Add $HOST to your ARD configuration.
EOF



_____________________________________________________________________
The information contained in this message and its attachments is
confidential and proprietary to LAIKA, Inc. By opening this email
or any of its attachments, you agree to keep all such information
confidential and not to use, distribute, disclose or copy any part
of such information without the prior written consent of LAIKA,
Inc. If you are not the intended recipient of this message, any use,
distribution, disclosure or copying of such information is prohibited.
If received in error, please contact the sender.


_______________________________________________
Do not post admin requests to the list. They will be ignored.
Installer-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Environment variable is not read in package postflight script
      • From: Nathan Duran <email@hidden>
  • Prev by Date: Re: version problems w/ Leopard installer
  • Next by Date: Re: Environment variable is not read in package postflight script
  • Previous by thread: Re: Installation "diverting" under development user
  • Next by thread: Re: Environment variable is not read in package postflight script
  • Index(es):
    • Date
    • Thread