Re: Struggles with PackageMaker and Iceberg scripts
Re: Struggles with PackageMaker and Iceberg scripts
- Subject: Re: Struggles with PackageMaker and Iceberg scripts
- From: Nick Peelman <email@hidden>
- Date: Tue, 16 Mar 2010 10:47:51 -0400
sudo shouldn't give you a second user via a "who" command. But a
Terminal window (or multiple terminal windows) will:
megrez:~ npeelman$ who
npeelman console Mar 15 09:06
npeelman ttys000 Mar 16 10:40
megrez:~ npeelman$ sudo who
Password:
npeelman console Mar 15 09:06
npeelman ttys000 Mar 16 10:40
When you run it from a command line what your script is seeing is the
console session and the tty session. When run via ARD, if no users
are logged in, that script should run fine (but I still suggest
testing it).
Short of building an array based on the awk $1 of the who command, my
only other suggest would be to grep for "console" between your who and
your awk, ie:
who | grep console | awk ' { print $1 } '.
-nick
--
Nick Peelman
email@hidden
On Mon, Mar 15, 2010 at 5:37 PM, Xochitl Lunde
<email@hidden> wrote:
> Thanks to some of the earlier discussions here, I have a package which I
> feel works fantastically with my launchd items. Unfortunately, it now does
> not work for me on the command line, oops!
>
> xochitl-lundes-imac:installcomponents xlunde$ installer -pkg
> sda/iceberg/build/PowerAlertSA-12.04.0050.pkg -target /Volumes/SNOWLEOPARD
> Java Update version is '1'.
> installer: This package requires authentication to install.
>
> xochitl-lundes-imac:installcomponents xlunde$ sudo installer -pkg
> sda/iceberg/build/PowerAlertSA-12.04.0050.pkg -target /Volumes/SNOWLEOPARD
> xlunde is logged in!
> installer: Error - Too many users are logged in. PowerAlert cannot be
> installed correctly for all users when multiple users are logged in.
>
> -----------------------
> Obviously, I did this to myself.
>
> for name in `who | awk {'print $1'}`
> do
> if [ ! $name = $USER ] ; then
> echo "${name} is logged in!"
> exit 112;
> fi
> done
>
> The multi-user check was based on some earlier discussion. Now when I run
> the installer on the command line using 'sudo', I get a different $USER in
> my environment. I know this will mess up my launchd agent later on in my
> preinstall and postinstall.
>
> I'm a little stumped on what direction to think about this. A command line
> install is required to not annoy the cheezeburgers out of anyone who
> administrates multiple computers, right? Are we supposed to use 'sudo' for
> packages that require admin privileges or is there a different way to do
> this? Is it the right thing to go through my scripts add an 'if $USER ==
> root' for everything?
>
> Xo
>
> _______________________________________________
> 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
>
_______________________________________________
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