diff options
author | Martin Wilke <miwi@FreeBSD.org> | 2009-03-19 16:33:06 +0000 |
---|---|---|
committer | Martin Wilke <miwi@FreeBSD.org> | 2009-03-19 16:33:06 +0000 |
commit | c1e9addf826e4d80867bc82c2744e3cfe530c595 (patch) | |
tree | dd037eb1e0890465325600efaf7f042ed9573218 /sysutils/dae | |
parent | 2efdafd92d33a64b6023ede88e6e49fde5fa4831 (diff) |
The dae program is used to list all daemon control scripts installed
within the rc.d system. It may also be used to execute any of these
scripts with the parameters provided.
PR: ports/132586
Submitted by: Dylan Bridgman
Notes
Notes:
svn path=/head/; revision=230414
Diffstat (limited to 'sysutils/dae')
-rw-r--r-- | sysutils/dae/Makefile | 28 | ||||
-rw-r--r-- | sysutils/dae/files/dae.1 | 56 | ||||
-rw-r--r-- | sysutils/dae/files/dae.sh | 53 | ||||
-rw-r--r-- | sysutils/dae/pkg-descr | 3 |
4 files changed, 140 insertions, 0 deletions
diff --git a/sysutils/dae/Makefile b/sysutils/dae/Makefile new file mode 100644 index 000000000000..c32ac1098119 --- /dev/null +++ b/sysutils/dae/Makefile @@ -0,0 +1,28 @@ +# New ports collection makefile for: dae +# Date created: 11 March 2009 +# Whom: Dylan Bridgman +# +# $FreeBSD$ +# + +PORTNAME= dae +PORTVERSION= 0.9 +CATEGORIES= sysutils +MASTER_SITES= #empty +DISTFILES= #none + +MAINTAINER= light@ether.org.za +COMMENT= List and control system daemon + +MAN1= dae.1 + +NO_WRKSUBDIR= yes +NO_BUILD= yes + +PLIST_FILES= sbin/dae + +do-install: + @${INSTALL_SCRIPT} ${FILESDIR}/dae.sh ${PREFIX}/sbin/dae + @${INSTALL_MAN} ${FILESDIR}/dae.1 ${MAN1PREFIX}/man/man1 + +.include <bsd.port.mk> diff --git a/sysutils/dae/files/dae.1 b/sysutils/dae/files/dae.1 new file mode 100644 index 000000000000..f210cbefb04a --- /dev/null +++ b/sysutils/dae/files/dae.1 @@ -0,0 +1,56 @@ +.\" Copyright (c) 2009 Dylan Bridgman. All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions are +.\" met: +.\" +.\" 1. Redistributions of source code must retain the above copyright notice +.\" this list of conditions and the following disclaimer. +.\" +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" 3. Neither the name of the author nor the names of its contributors may be +.\" used to endorse or promote products derived from this software without +.\" specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, +.\" INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY +.\" AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +.\" COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +.\" +.\" $Id$ +.\" +.TH dae 1 "2009 March 11" +.SH NAME +dae \- List and control system daemons +.SH SYNOPSIS +.PP +.B dae +[\-a] | [\-l] | [\-L] | <service-name> [action] | [\-h] +.SH DESCRIPTION +The \fIdae\fP program is used to list all daemon control scripts installed within +the rc.d system. It may also be used to execute any of these scripts with the parameters provided. +.SH OPTIONS +.TP +\-h display a short help message +.TP +\-a show all daemon scripts +.TP +\-l show system daemon scripts +.TP +\-L show port daemon scripts +.TP +\-x show X11 daemon scripts +.SH AUTHOR +Dylan Bridgman (light (at) ether.org.za) +.SH SEE ALSO +rc(8), rcorder(8) + diff --git a/sysutils/dae/files/dae.sh b/sysutils/dae/files/dae.sh new file mode 100644 index 000000000000..69559b31aa29 --- /dev/null +++ b/sysutils/dae/files/dae.sh @@ -0,0 +1,53 @@ +#!/bin/sh + +### +# Author: Light +# Email: isibane@gmail.com +### + +usage() +{ + echo "Usage: `basename $0` [-a] | [-l] | [-L] | <service-name> [action]" + echo -e "\t-h Show this message" + echo -e "\t-a Show all service names" + echo -e "\t-l Show system service names" + echo -e "\t-L Show port service names" + echo -e "\t-x Show X11 service names" + exit 1 +} + +list_system() { find /etc/rc.d -type f -perm +a+x 2>/dev/null; } +list_ports() { find /usr/local/etc/rc.d -type f -perm +a+x 2>/dev/null; } +list_x11() { find /usr/X11R6/etc/rc.d -type f -perm +a+x 2>/dev/null; } +list_filter() { sed "s/.sh$//g;s/.*\\///g" | sort | column; } + +set -- `getopt "ahlLx" "$@"` || { + usage +} +while : +do + case "$1" in + -a) ( list_system; list_ports; list_x11) | list_filter; exit 0 ;; + -l) list_system | list_filter; exit 0 ;; + -L) list_ports | list_filter; exit 0 ;; + -x) list_x11 | list_filter; exit 0 ;; + -h) usage ;; + --) break ;; + esac + shift +done +shift +if [ -z "$1" ] +then + usage +fi +service_name=`( list_system; list_ports; list_x11 ) | grep -e "/$1[^/]*$\|/$1[^/]*\.sh$" | head -n 1` +if [ -z "$service_name" ] +then + echo "Error: Unknown service '$1*[.sh]'" + echo + usage +else + $service_name $2 +fi +exit 0 diff --git a/sysutils/dae/pkg-descr b/sysutils/dae/pkg-descr new file mode 100644 index 000000000000..aea5ba07342d --- /dev/null +++ b/sysutils/dae/pkg-descr @@ -0,0 +1,3 @@ +The dae program is used to list all daemon control scripts installed +within the rc.d system. It may also be used to execute any of these +scripts with the parameters provided. |