On Fri, 28 Aug 2009 09:24:35 +0100, Jeronimo Calvo 
<jeronimocal...@googlemail.com> wrote:
> content of script:
> ]#!/usr/local/bin/bash
  ^
This ] doesn't belong to the script, does it?

Furthermore, why do you employ bash for calling another program?
It's standard to use sh (#!/bin/sh) if you don't use bash-specific
commands and constructs, and I don't see them here. If you care
for portablility, such a script is an absulute no-go.

Furthermore, in order to perform

        shutdown -p now

it's more convenient to use the sudo command (from ports) and add
a rule (for maximum security) for the specific user who you want
to be able to run this command.

Finally, it's possible to place the user in question into the
group "operator", then he can perform the above command without
needing (1st) sudo and (2nd) bash. Look at the permissions of
the shutdown program:

        -r-sr-x---  1 root  operator  /sbin/shutdown*

Members of "operator" are +x for this binary.




-- 
Polytropon
Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...
_______________________________________________
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"

Reply via email to