epoch1970;477895 Wrote:
> Right, the script as is here returns failure on OSX, because
> squeezeboxserver does not exist. Further, this script is not very useful
> on OS X, since if you can sudo, then you can sudo... as you point out.
> Nevertheless, it catches failure or success.
What we're trying to establish here is the ability to execute shutdown
and other commands with no password prompt. I'm just not sure how to do
this on OSX inside of a script. From my testing on OSX, it didn't seem
as though your script was able to establish this.
I wonder if this would work...again, assuming that the script has been
run via sudo:
Code:
--------------------
SBSUSER=`/usr/bin/logname`
echo "" | sudo -S -u $SBSUSER sudo -S -k /sbin/shutdown -k now >/dev/null
2>&1 && OK=1 || OK=0;
--------------------
That gives you sudo nested three deep. I'm still not completely sure
that will cause sudo to prompt for $SBSUSER's password if $SBSUSER has
already presented its credentials to run the script.
A safer, if more primitive direction for mac users perhaps should be
the instructions to run:
sudo -K
sudo shutdown -k now
..from the terminal. That ought to show conclusively if any password
prompts are being raised.
epoch1970;477895 Wrote:
> Doing "sudo -u squeezeboxserver -k" is not possible, but it looks like
> "sudo -u squeezeboxserver sudo -k" does reset the password timeout for
> user squeezeboxserver.
Yes. What I've settled on in the linux help pages is:
sudo -u squeezeboxserver sudo -k /sbin/shutdown -k -h now
--
gharris999
------------------------------------------------------------------------
gharris999's Profile: http://forums.slimdevices.com/member.php?userid=115
View this thread: http://forums.slimdevices.com/showthread.php?t=48521
_______________________________________________
plugins mailing list
[email protected]
http://lists.slimdevices.com/mailman/listinfo/plugins