1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-11-20 00:21:35 +00:00

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
This commit is contained in:
Martin Wilke 2009-03-19 16:33:06 +00:00
parent 2efdafd92d
commit c1e9addf82
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=230414
5 changed files with 141 additions and 0 deletions

View File

@ -126,6 +126,7 @@
SUBDIR += cvsweb-converters
SUBDIR += cw
SUBDIR += daa2iso
SUBDIR += dae
SUBDIR += daedalus
SUBDIR += daemontools
SUBDIR += daemontools53

28
sysutils/dae/Makefile Normal file
View File

@ -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>

56
sysutils/dae/files/dae.1 Normal file
View File

@ -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)

53
sysutils/dae/files/dae.sh Normal file
View File

@ -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

3
sysutils/dae/pkg-descr Normal file
View File

@ -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.