[Pm-utils] [PATCH] use service unconditionally

Frank Seidel fseidel at suse.de
Mon Mar 12 03:39:00 PDT 2007


On Monday 12 March 2007 08:25:53 Stefan Seyfried wrote:
> On Sat, Mar 10, 2007 at 09:11:14PM +0100, Tim Dijkstra wrote:
> > It appears that is inevitable that we introduce distro specific
> > functions here, because you do not appear to have /etc/init.d and
> > we don't have service.
>
> how about (untested!):
> [...]
> +	type service >/dev/null 2>&1
> +	if [ $? = 0 ]; then
> +		service "$@"
> +	elif [ -x "/etc/init.d/$1" ]; then
> +		"/etc/init.d/$@"
> +	else
In my opinion thats a very good way to solve this.
I vote for this patch.

Have fun,
Frank
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/pm-utils/attachments/20070312/09ee3ea2/attachment.pgp


More information about the Pm-utils mailing list