From 546041ba3113a4a58d8f3e7e7cb90e78fcb38ea8 Mon Sep 17 00:00:00 2001 From: Thomas Gellekum Date: Wed, 5 Jul 2000 12:37:06 +0000 Subject: As threatened on freebsd-ports: all startup scripts know about the two options `start' and `stop' now (unless I have forgotten any). This allows us to call the scripts from /etc/rc.shutdown with the correct option. The (42 or so) ports that already DTRT before are unchanged. --- net/arpwatch-devel/files/arpwatch.sh | 20 +++++++++++++++++--- net/arpwatch/files/arpwatch.sh | 20 +++++++++++++++++--- net/dhid/Makefile | 4 +--- net/dhid/files/dhid.sh | 20 ++++++++++++++++++++ net/generic-nqs/files/nqs.sh | 21 +++++++++++++++++---- net/gnu-finger/files/fingerd.sh.sample | 22 ++++++++++++++++++---- net/net-snmp/Makefile | 4 +--- net/net-snmp/files/snmpd.sh.sample | 20 ++++++++++++++++++++ net/net-snmp4/Makefile | 4 +--- net/net-snmp4/files/snmpd.sh.sample | 20 ++++++++++++++++++++ net/poptop/files/pptpd.sh | 16 +++++++++++++++- net/priss/files/qtss.sh | 16 +++++++++++++++- net/rwhois/Makefile | 9 +-------- net/rwhois/files/rwhoisd.sh | 23 +++++++++++++++++++++++ net/rwhoisd/Makefile | 9 +-------- net/rwhoisd/files/rwhoisd.sh | 23 +++++++++++++++++++++++ net/tac_plus4/Makefile | 4 +--- net/tac_plus4/files/tac_plus.sh | 20 ++++++++++++++++++++ net/tcserver/Makefile | 4 +--- net/tdetect/Makefile | 5 +---- net/tdetect/files/tdetect.sh | 22 ++++++++++++++++++++++ net/ucd-snmp/Makefile | 4 +--- net/ucd-snmp/files/snmpd.sh.sample | 20 ++++++++++++++++++++ net/wide-dhcp/Makefile | 20 +------------------- net/wide-dhcp/files/wide-dhcps.sh.sample | 30 ++++++++++++++++++++++++++++++ net/zephyr/files/zhm.sh | 20 ++++++++++++++++---- 26 files changed, 323 insertions(+), 77 deletions(-) create mode 100644 net/dhid/files/dhid.sh create mode 100644 net/net-snmp/files/snmpd.sh.sample create mode 100644 net/net-snmp4/files/snmpd.sh.sample create mode 100644 net/rwhois/files/rwhoisd.sh create mode 100644 net/rwhoisd/files/rwhoisd.sh create mode 100644 net/tac_plus4/files/tac_plus.sh create mode 100644 net/tdetect/files/tdetect.sh create mode 100644 net/ucd-snmp/files/snmpd.sh.sample create mode 100644 net/wide-dhcp/files/wide-dhcps.sh.sample (limited to 'net') diff --git a/net/arpwatch-devel/files/arpwatch.sh b/net/arpwatch-devel/files/arpwatch.sh index ebaf7946aac9..f0c8a797cb54 100644 --- a/net/arpwatch-devel/files/arpwatch.sh +++ b/net/arpwatch-devel/files/arpwatch.sh @@ -1,4 +1,18 @@ #!/bin/sh -if [ -x /usr/local/sbin/arpwatch -a -d /usr/local/arpwatch ]; then - /usr/local/sbin/arpwatch && echo -n ' arpwatch' -fi + +case $1 in +start) + if [ -x /usr/local/sbin/arpwatch -a -d /usr/local/arpwatch ]; then + /usr/local/sbin/arpwatch && echo -n ' arpwatch' + fi + ;; +stop) + killall arpwatch && echo -n ' arpwatch' + ;; +*) + echo "Usage: `basename $0` {start|stop}" >&2 + exit 64 + ;; +esac + +exit 0 diff --git a/net/arpwatch/files/arpwatch.sh b/net/arpwatch/files/arpwatch.sh index ebaf7946aac9..f0c8a797cb54 100644 --- a/net/arpwatch/files/arpwatch.sh +++ b/net/arpwatch/files/arpwatch.sh @@ -1,4 +1,18 @@ #!/bin/sh -if [ -x /usr/local/sbin/arpwatch -a -d /usr/local/arpwatch ]; then - /usr/local/sbin/arpwatch && echo -n ' arpwatch' -fi + +case $1 in +start) + if [ -x /usr/local/sbin/arpwatch -a -d /usr/local/arpwatch ]; then + /usr/local/sbin/arpwatch && echo -n ' arpwatch' + fi + ;; +stop) + killall arpwatch && echo -n ' arpwatch' + ;; +*) + echo "Usage: `basename $0` {start|stop}" >&2 + exit 64 + ;; +esac + +exit 0 diff --git a/net/dhid/Makefile b/net/dhid/Makefile index 622c66866d7b..e01835a2e849 100644 --- a/net/dhid/Makefile +++ b/net/dhid/Makefile @@ -26,9 +26,7 @@ do-install: post-install: @if [ ! -f ${PREFIX}/etc/rc.d/dhid.sh ]; then \ ${ECHO} "===> Installing ${PREFIX}/etc/rc.d/dhid.sh startup file."; \ - ${ECHO} "#!/bin/sh" > ${PREFIX}/etc/rc.d/dhid.sh; \ - ${ECHO} "[ -x \"${PREFIX}/sbin/dhid\" -a -f \"${PREFIX}/etc/dhid.conf\" ] && ${PREFIX}/sbin/dhid > /dev/null && ${ECHO} -n ' dhid'" >> ${PREFIX}/etc/rc.d/dhid.sh; \ - ${CHMOD} 751 ${PREFIX}/etc/rc.d/dhid.sh; \ + ${INSTALL_SCRIPT} -m 751 ${FILESDIR}/dhid.sh ${PREFIX}/etc/rc.d/dhid.sh; \ fi; @${ECHO} "--------------------------------------------------------------------------" @${ECHO} "Before dhid can run, you will need to register with a DHIS provider." diff --git a/net/dhid/files/dhid.sh b/net/dhid/files/dhid.sh new file mode 100644 index 000000000000..510f4ab70d16 --- /dev/null +++ b/net/dhid/files/dhid.sh @@ -0,0 +1,20 @@ +#!/bin/sh + +if ! PREFIX=$(expr $0 : "\(/.*\)/etc/rc\.d/$(basename $0)\$"); then + echo "$0: Cannot determine the PREFIX" >&2 + exit 1 +fi + +case "$1" in +start) + [ -x "${PREFIX}/sbin/dhid" -a -f "${PREFIX}/etc/dhid.conf" ] && ${PREFIX}/sbin/dhid > /dev/null && echo -n ' dhid' + ;; +stop) + killall dhid && echo -n ' dhid' + ;; +*) + echo "Usage: `basename $0` {start|stop}" >&2 + ;; +esac + +exit 0 diff --git a/net/generic-nqs/files/nqs.sh b/net/generic-nqs/files/nqs.sh index 594a56771dbe..fbdb6ffa0adb 100644 --- a/net/generic-nqs/files/nqs.sh +++ b/net/generic-nqs/files/nqs.sh @@ -1,6 +1,19 @@ #!/bin/sh -if [ -x XXXX/sbin/nqsdaemon ] ; then - XXXX/sbin/nqsdaemon > /var/log/nqs.log - echo -n ' nqs' -fi +case $1 in +start) + if [ -x XXXX/sbin/nqsdaemon ] ; then + XXXX/sbin/nqsdaemon > /var/log/nqs.log + echo -n ' nqs' + fi + ;; +stop) + killall nqsdaemon && echo -n ' nqs' + ;; +*) + echo "Usage: `basename $0` {start|stop}" >&2 + exit 64 + ;; +esac + +exit 0 diff --git a/net/gnu-finger/files/fingerd.sh.sample b/net/gnu-finger/files/fingerd.sh.sample index edd1a5f8b0b6..ef6b4fff34cf 100644 --- a/net/gnu-finger/files/fingerd.sh.sample +++ b/net/gnu-finger/files/fingerd.sh.sample @@ -1,5 +1,19 @@ #!/bin/sh -if [ -x /usr/local/libexec/fingerd -a -f /usr/local/etc/fingerdir/serverhost ]; then - /usr/local/libexec/fingerd - echo ' gnu-fingerd' -fi + +case $1 in +start) + if [ -x /usr/local/libexec/fingerd -a -f /usr/local/etc/fingerdir/serverhost ]; then + /usr/local/libexec/fingerd + echo ' gnu-fingerd' + fi + ;; +stop) + killall fingerd && echo -n ' gnu-fingerd' + ;; +*) + echo "Usage: `basename $0` {start|stop}" >&2 + exit 64 + ;; +esac + +exit 0 diff --git a/net/net-snmp/Makefile b/net/net-snmp/Makefile index f7de629c1338..a6810058b6bc 100644 --- a/net/net-snmp/Makefile +++ b/net/net-snmp/Makefile @@ -66,9 +66,7 @@ post-install: ${INSTALL_DATA} $$F ${PREFIX}/share/examples/ucd-snmp ; done @if [ ! -f ${STARTUP_FILE} ]; then \ ${ECHO} "Creating ${PREFIX}/etc/rc.d/snmpd.sh startup file."; \ - ${ECHO} "#!/bin/sh" > ${STARTUP_FILE}; \ - ${ECHO} "[ -x ${PREFIX}/sbin/snmpd ] && ${PREFIX}/sbin/snmpd && ${ECHO} -n ' snmpd'" >> ${STARTUP_FILE}; \ - ${CHMOD} 751 ${STARTUP_FILE}; \ + ${INSTALL_SCRIPT} -m 751 ${FILESDIR}/snmpd.sh.sample ${STARTUP_FILE}; \ fi .include diff --git a/net/net-snmp/files/snmpd.sh.sample b/net/net-snmp/files/snmpd.sh.sample new file mode 100644 index 000000000000..71f8b504ce81 --- /dev/null +++ b/net/net-snmp/files/snmpd.sh.sample @@ -0,0 +1,20 @@ +#!/bin/sh + +if ! PREFIX=$(expr $0 : "\(/.*\)/etc/rc\.d/$(basename $0)\$"); then + echo "$0: Cannot determine the PREFIX" >&2 + exit 1 +fi + +case "$1" in +start) + [ -x ${PREFIX}/sbin/snmpd ] && ${PREFIX}/sbin/snmpd && echo -n ' snmpd' + ;; +stop) + killall snmpd && echo -n ' snmpd' + ;; +*) + echo "Usage: `basename $0` {start|stop}" >&2 + ;; +esac + +exit 0 diff --git a/net/net-snmp4/Makefile b/net/net-snmp4/Makefile index f7de629c1338..a6810058b6bc 100644 --- a/net/net-snmp4/Makefile +++ b/net/net-snmp4/Makefile @@ -66,9 +66,7 @@ post-install: ${INSTALL_DATA} $$F ${PREFIX}/share/examples/ucd-snmp ; done @if [ ! -f ${STARTUP_FILE} ]; then \ ${ECHO} "Creating ${PREFIX}/etc/rc.d/snmpd.sh startup file."; \ - ${ECHO} "#!/bin/sh" > ${STARTUP_FILE}; \ - ${ECHO} "[ -x ${PREFIX}/sbin/snmpd ] && ${PREFIX}/sbin/snmpd && ${ECHO} -n ' snmpd'" >> ${STARTUP_FILE}; \ - ${CHMOD} 751 ${STARTUP_FILE}; \ + ${INSTALL_SCRIPT} -m 751 ${FILESDIR}/snmpd.sh.sample ${STARTUP_FILE}; \ fi .include diff --git a/net/net-snmp4/files/snmpd.sh.sample b/net/net-snmp4/files/snmpd.sh.sample new file mode 100644 index 000000000000..71f8b504ce81 --- /dev/null +++ b/net/net-snmp4/files/snmpd.sh.sample @@ -0,0 +1,20 @@ +#!/bin/sh + +if ! PREFIX=$(expr $0 : "\(/.*\)/etc/rc\.d/$(basename $0)\$"); then + echo "$0: Cannot determine the PREFIX" >&2 + exit 1 +fi + +case "$1" in +start) + [ -x ${PREFIX}/sbin/snmpd ] && ${PREFIX}/sbin/snmpd && echo -n ' snmpd' + ;; +stop) + killall snmpd && echo -n ' snmpd' + ;; +*) + echo "Usage: `basename $0` {start|stop}" >&2 + ;; +esac + +exit 0 diff --git a/net/poptop/files/pptpd.sh b/net/poptop/files/pptpd.sh index eeb61a0a7a63..f2e9d47f2bb7 100644 --- a/net/poptop/files/pptpd.sh +++ b/net/poptop/files/pptpd.sh @@ -1,2 +1,16 @@ #! /bin/sh -[ -x /usr/local/sbin/pptpd ] && /usr/local/sbin/pptpd && echo -n ' pptpd' + +case $1 in +start) + [ -x /usr/local/sbin/pptpd ] && /usr/local/sbin/pptpd && echo -n ' pptpd' + ;; +stop) + killall pptpd && echo -n ' pptpd' + ;; +*) + echo "Usage: `basename $0` {start|stop}" >&2 + exit 64 + ;; +esac + +exit 0 diff --git a/net/priss/files/qtss.sh b/net/priss/files/qtss.sh index d25ba7161308..4d4aba97fa8a 100644 --- a/net/priss/files/qtss.sh +++ b/net/priss/files/qtss.sh @@ -4,4 +4,18 @@ cd `dirname $0` cd ../.. PREFIX=`pwd` QTSS_PROXY=${PREFIX}/sbin/QuickTimeStreamingServer -[ -x ${QTSS_PROXY} ] && ${QTSS_PROXY} && echo -n ' qtss' + +case $1 in +start) + [ -x ${QTSS_PROXY} ] && ${QTSS_PROXY} && echo -n ' qtss' + ;; +stop) + killall `basename ${QTSS_PROXY}` && echo -n ' qtss' + ;; +*) + echo "Usage: `basename $0` {start|stop}" >&2 + exit 64 + ;; +esac + +exit 0 diff --git a/net/rwhois/Makefile b/net/rwhois/Makefile index 8af4dc9c363b..9ea1b154b7f8 100644 --- a/net/rwhois/Makefile +++ b/net/rwhois/Makefile @@ -38,13 +38,6 @@ post-install: ${MV} ${PREFIX}/share/doc/rwhois/rmkdbindex.8 ${PREFIX}/man/man8 ${MV} ${PREFIX}/share/doc/rwhois/rwhoisd.8 ${PREFIX}/man/man8 @ ${ECHO_MSG} "Installing ${PREFIX}/etc/rc.d/rwhoisd.sh startup file..." - @ ${ECHO} "#!/bin/sh" > ${PREFIX}/etc/rc.d/rwhoisd.sh - @ ${ECHO} "#" >> ${PREFIX}/etc/rc.d/rwhoisd.sh - @ ${ECHO} "" >> ${PREFIX}/etc/rc.d/rwhoisd.sh - @ ${ECHO} "# remove or comment the following line and uncomment the one below it once you have" >> ${PREFIX}/etc/rc.d/rwhoisd.sh - @ ${ECHO} "# configured your server's data" >> ${PREFIX}/etc/rc.d/rwhoisd.sh - @ ${ECHO} "${ECHO} \"rwhoisd not started; sample data still in place. See ${PREFIX}/share/doc/rwhois for details.\"" >> ${PREFIX}/etc/rc.d/rwhoisd.sh - @ ${ECHO} "#[ -x ${PREFIX}/lib/rwhois/sbin/rwhoisd ] && ${PREFIX}/lib/rwhois/sbin/rwhoisd -c ${PREFIX}/lib/rwhois/rwhois.conf & && ${ECHO} -n ' rwhoisd'" >> ${PREFIX}/etc/rc.d/rwhoisd.sh - ${CHMOD} 751 ${PREFIX}/etc/rc.d/rwhoisd.sh + ${INSTALL_SCRIPT} -m 751 ${FILESDIR}/rwhoisd.sh ${PREFIX}/etc/rc.d/rwhoisd.sh .include diff --git a/net/rwhois/files/rwhoisd.sh b/net/rwhois/files/rwhoisd.sh new file mode 100644 index 000000000000..08c071bd0e42 --- /dev/null +++ b/net/rwhois/files/rwhoisd.sh @@ -0,0 +1,23 @@ +#!/bin/sh + +if ! PREFIX=$(expr $0 : "\(/.*\)/etc/rc\.d/$(basename $0)\$"); then + echo "$0: Cannot determine the PREFIX" >&2 + exit 1 +fi + +case "$1" in +start) + # remove or comment the following line and uncomment the one below it once you have + # configured your server's data + echo "rwhoisd not started; sample data still in place. See ${PREFIX}/share/doc/rwhois for details." + #[ -x ${PREFIX}/lib/rwhois/sbin/rwhoisd ] && ${PREFIX}/lib/rwhois/sbin/rwhoisd -c ${PREFIX}/lib/rwhois/rwhois.conf & && echo -n ' rwhoisd' + ;; +stop) + # killall rwhoisd && echo -n ' rwhoisd + ;; +*) + echo "Usage: `basename $0` {start|stop}" >&2 + ;; +esac + +exit 0 diff --git a/net/rwhoisd/Makefile b/net/rwhoisd/Makefile index 8af4dc9c363b..9ea1b154b7f8 100644 --- a/net/rwhoisd/Makefile +++ b/net/rwhoisd/Makefile @@ -38,13 +38,6 @@ post-install: ${MV} ${PREFIX}/share/doc/rwhois/rmkdbindex.8 ${PREFIX}/man/man8 ${MV} ${PREFIX}/share/doc/rwhois/rwhoisd.8 ${PREFIX}/man/man8 @ ${ECHO_MSG} "Installing ${PREFIX}/etc/rc.d/rwhoisd.sh startup file..." - @ ${ECHO} "#!/bin/sh" > ${PREFIX}/etc/rc.d/rwhoisd.sh - @ ${ECHO} "#" >> ${PREFIX}/etc/rc.d/rwhoisd.sh - @ ${ECHO} "" >> ${PREFIX}/etc/rc.d/rwhoisd.sh - @ ${ECHO} "# remove or comment the following line and uncomment the one below it once you have" >> ${PREFIX}/etc/rc.d/rwhoisd.sh - @ ${ECHO} "# configured your server's data" >> ${PREFIX}/etc/rc.d/rwhoisd.sh - @ ${ECHO} "${ECHO} \"rwhoisd not started; sample data still in place. See ${PREFIX}/share/doc/rwhois for details.\"" >> ${PREFIX}/etc/rc.d/rwhoisd.sh - @ ${ECHO} "#[ -x ${PREFIX}/lib/rwhois/sbin/rwhoisd ] && ${PREFIX}/lib/rwhois/sbin/rwhoisd -c ${PREFIX}/lib/rwhois/rwhois.conf & && ${ECHO} -n ' rwhoisd'" >> ${PREFIX}/etc/rc.d/rwhoisd.sh - ${CHMOD} 751 ${PREFIX}/etc/rc.d/rwhoisd.sh + ${INSTALL_SCRIPT} -m 751 ${FILESDIR}/rwhoisd.sh ${PREFIX}/etc/rc.d/rwhoisd.sh .include diff --git a/net/rwhoisd/files/rwhoisd.sh b/net/rwhoisd/files/rwhoisd.sh new file mode 100644 index 000000000000..08c071bd0e42 --- /dev/null +++ b/net/rwhoisd/files/rwhoisd.sh @@ -0,0 +1,23 @@ +#!/bin/sh + +if ! PREFIX=$(expr $0 : "\(/.*\)/etc/rc\.d/$(basename $0)\$"); then + echo "$0: Cannot determine the PREFIX" >&2 + exit 1 +fi + +case "$1" in +start) + # remove or comment the following line and uncomment the one below it once you have + # configured your server's data + echo "rwhoisd not started; sample data still in place. See ${PREFIX}/share/doc/rwhois for details." + #[ -x ${PREFIX}/lib/rwhois/sbin/rwhoisd ] && ${PREFIX}/lib/rwhois/sbin/rwhoisd -c ${PREFIX}/lib/rwhois/rwhois.conf & && echo -n ' rwhoisd' + ;; +stop) + # killall rwhoisd && echo -n ' rwhoisd + ;; +*) + echo "Usage: `basename $0` {start|stop}" >&2 + ;; +esac + +exit 0 diff --git a/net/tac_plus4/Makefile b/net/tac_plus4/Makefile index 491b88a89b9a..e6b03f3714f8 100644 --- a/net/tac_plus4/Makefile +++ b/net/tac_plus4/Makefile @@ -29,9 +29,7 @@ do-install: ${INSTALL_DATA} ${FILESDIR}/tac_plus.conf.example ${PREFIX}/etc/ @if [ ! -f ${PREFIX}/etc/rc.d/tac_plus.sh ]; then \ ${ECHO} "Installing ${PREFIX}/etc/rc.d/tac_plus.sh startup file."; \ - ${ECHO} "#!/bin/sh" > ${PREFIX}/etc/rc.d/tac_plus.sh; \ - ${ECHO} "[ -x ${PREFIX}/sbin/tac_plus -a -f ${PREFIX}/etc/tac_plus.conf ] && ${PREFIX}/sbin/tac_plus -C ${PREFIX}/etc/tac_plus.conf && echo -n ' tac_plus'" >> ${PREFIX}/etc/rc.d/tac_plus.sh; \ - chmod 751 ${PREFIX}/etc/rc.d/tac_plus.sh; \ + ${INSTALL_SCRIPT} -m 751 ${FILESDIR}/tac_plus.sh ${PREFIX}/etc/rc.d/tac_plus.sh; \ fi .if !defined(NOPORTDOCS) @${MKDIR} ${PREFIX}/share/doc/tac_plus diff --git a/net/tac_plus4/files/tac_plus.sh b/net/tac_plus4/files/tac_plus.sh new file mode 100644 index 000000000000..be86c91da222 --- /dev/null +++ b/net/tac_plus4/files/tac_plus.sh @@ -0,0 +1,20 @@ +#!/bin/sh + +if ! PREFIX=$(expr $0 : "\(/.*\)/etc/rc\.d/$(basename $0)\$"); then + echo "$0: Cannot determine the PREFIX" >&2 + exit 1 +fi + +case "$1" in +start) + [ -x ${PREFIX}/sbin/tac_plus -a -f ${PREFIX}/etc/tac_plus.conf ] && ${PREFIX}/sbin/tac_plus -C ${PREFIX}/etc/tac_plus.conf && echo -n ' tac_plus' + ;; +stop) + killall tac_plus && echo -n ' tac_plus' + ;; +*) + echo "Usage: `basename $0` {start|stop}" >&2 + ;; +esac + +exit 0 diff --git a/net/tcserver/Makefile b/net/tcserver/Makefile index 6bb631c0bf3d..78e6ed5c76b6 100644 --- a/net/tcserver/Makefile +++ b/net/tcserver/Makefile @@ -56,9 +56,7 @@ do-install: post-install: @if [ ! -f ${PREFIX}/etc/rc.d/elsa.sh ]; then \ ${ECHO} "Installing ${PREFIX}/etc/rc.d/elsa.sh startup file."; \ - ${ECHO} "#!/bin/sh" > ${PREFIX}/etc/rc.d/elsa.sh; \ - ${ECHO} "[ -x ${PREFIX}/sbin/elsa ] && ${PREFIX}/sbin/elsa -d ${PREFIX}/etc > /dev/null & && ${ECHO} -n ' elsa'" >> ${PREFIX}/etc/rc.d/elsa.sh; \ - ${CHMOD} 555 ${PREFIX}/etc/rc.d/elsa.sh; \ + ${INSTALL_SCRIPT} ${FILESDIR}/elsa.sh ${PREFIX}/etc/rc.d/elsa.sh; \ fi .include diff --git a/net/tdetect/Makefile b/net/tdetect/Makefile index 9793bc94e3ae..30fb3f68db5f 100644 --- a/net/tdetect/Makefile +++ b/net/tdetect/Makefile @@ -28,10 +28,7 @@ do-install: post-install: @if [ ! -f ${PREFIX}/etc/rc.d/tdetect.sh ]; then \ ${ECHO} "Installing ${PREFIX}/etc/rc.d/tdetect.sh startup file."; \ - ${ECHO} "#!/bin/sh" > ${PREFIX}/etc/rc.d/tdetect.sh; \ - ${ECHO} "ETHERNETDEV=ed0" >> ${PREFIX}/etc/rc.d/tdetect.sh; \ - ${ECHO} '[ -x ${PREFIX}/sbin/tdetect ] && ${PREFIX}/sbin/tdetect $$ETHERNETDEV && ${ECHO} -n " tdetect"' >> ${PREFIX}/etc/rc.d/tdetect.sh; \ - ${CHMOD} 750 ${PREFIX}/etc/rc.d/tdetect.sh; \ + ${INSTALL_SCRIPT} -m 750 ${FILESDIR}/tdetect.sh ${PREFIX}/etc/rc.d/tdetect.sh; \ ${SED} -e 's,/usr/local,${PREFIX},g' ${PKGMESSAGE}; \ fi diff --git a/net/tdetect/files/tdetect.sh b/net/tdetect/files/tdetect.sh new file mode 100644 index 000000000000..d12593c9af97 --- /dev/null +++ b/net/tdetect/files/tdetect.sh @@ -0,0 +1,22 @@ +#!/bin/sh + +if ! PREFIX=$(expr $0 : "\(/.*\)/etc/rc\.d/$(basename $0)\$"); then + echo "$0: Cannot determine the PREFIX" >&2 + exit 1 +fi + +ETHERNETDEV=ed0 + +case "$1" in +start) + [ -x ${PREFIX}/sbin/tdetect ] && ${PREFIX}/sbin/tdetect $ETHERNETDEV && echo -n " tdetect" + ;; +stop) + killall tdetect && echo -n " tdetect" + ;; +*) + echo "Usage: `basename $0` {start|stop}" >&2 + ;; +esac + +exit 0 diff --git a/net/ucd-snmp/Makefile b/net/ucd-snmp/Makefile index f7de629c1338..a6810058b6bc 100644 --- a/net/ucd-snmp/Makefile +++ b/net/ucd-snmp/Makefile @@ -66,9 +66,7 @@ post-install: ${INSTALL_DATA} $$F ${PREFIX}/share/examples/ucd-snmp ; done @if [ ! -f ${STARTUP_FILE} ]; then \ ${ECHO} "Creating ${PREFIX}/etc/rc.d/snmpd.sh startup file."; \ - ${ECHO} "#!/bin/sh" > ${STARTUP_FILE}; \ - ${ECHO} "[ -x ${PREFIX}/sbin/snmpd ] && ${PREFIX}/sbin/snmpd && ${ECHO} -n ' snmpd'" >> ${STARTUP_FILE}; \ - ${CHMOD} 751 ${STARTUP_FILE}; \ + ${INSTALL_SCRIPT} -m 751 ${FILESDIR}/snmpd.sh.sample ${STARTUP_FILE}; \ fi .include diff --git a/net/ucd-snmp/files/snmpd.sh.sample b/net/ucd-snmp/files/snmpd.sh.sample new file mode 100644 index 000000000000..71f8b504ce81 --- /dev/null +++ b/net/ucd-snmp/files/snmpd.sh.sample @@ -0,0 +1,20 @@ +#!/bin/sh + +if ! PREFIX=$(expr $0 : "\(/.*\)/etc/rc\.d/$(basename $0)\$"); then + echo "$0: Cannot determine the PREFIX" >&2 + exit 1 +fi + +case "$1" in +start) + [ -x ${PREFIX}/sbin/snmpd ] && ${PREFIX}/sbin/snmpd && echo -n ' snmpd' + ;; +stop) + killall snmpd && echo -n ' snmpd' + ;; +*) + echo "Usage: `basename $0` {start|stop}" >&2 + ;; +esac + +exit 0 diff --git a/net/wide-dhcp/Makefile b/net/wide-dhcp/Makefile index 6eb19087709d..1078aaaf5ac4 100644 --- a/net/wide-dhcp/Makefile +++ b/net/wide-dhcp/Makefile @@ -46,25 +46,7 @@ post-install: .endif @if [ ! -f ${STARTUP_SCRIPT} ]; then \ ${ECHO} "Installing ${STARTUP_SCRIPT} startup file."; \ - ${ECHO} '#!/bin/sh' > ${STARTUP_SCRIPT}; \ - ${ECHO} 'DB_POOL=/etc/dhcpdb.pool' >> ${STARTUP_SCRIPT}; \ - ${ECHO} 'DB_RELAY=/etc/dhcpdb.relay' >> ${STARTUP_SCRIPT}; \ - ${ECHO} 'DB_BIND=/var/db/dhcpdb.bind' >> ${STARTUP_SCRIPT}; \ - ${ECHO} 'if [ -f $${DB_POOL} -a -f $${DB_RELAY} \' \ - >> ${STARTUP_SCRIPT}; \ - ${ECHO} ' -a -x ${PREFIX}/sbin/dhcps ]; then' \ - >> ${STARTUP_SCRIPT}; \ - ${ECHO} ' if [ -f $${DB_BIND} ]; then' >> ${STARTUP_SCRIPT}; \ - ${ECHO} ' find $${DB_POOL} -newer $${DB_BIND} -exec ${RM} $${DB_BIND} \;' \ - >> ${STARTUP_SCRIPT}; \ - ${ECHO} ' fi' >> ${STARTUP_SCRIPT}; \ - ${ECHO} " ${PREFIX}/sbin/dhcps [Interface Name]" \ - >> ${STARTUP_SCRIPT}; \ - ${ECHO} " ${ECHO} -n ' dhcps'" \ - >> ${STARTUP_SCRIPT}; \ - ${ECHO} 'fi' >> ${STARTUP_SCRIPT}; \ - ${CHMOD} 755 ${STARTUP_SCRIPT}; \ - ${CHOWN} bin.bin ${STARTUP_SCRIPT}; \ + ${INSTALL_SCRIPT} ${FILESDIR}/wide-dhcps.sh.sample ${STARTUP_SCRIPT}; \ fi @if [ ! -c /dev/bpf1 ]; then \ ${ECHO} "********************************************************";\ diff --git a/net/wide-dhcp/files/wide-dhcps.sh.sample b/net/wide-dhcp/files/wide-dhcps.sh.sample new file mode 100644 index 000000000000..6cab4e824a0f --- /dev/null +++ b/net/wide-dhcp/files/wide-dhcps.sh.sample @@ -0,0 +1,30 @@ +#!/bin/sh + +if ! PREFIX=$(expr $0 : "\(/.*\)/etc/rc\.d/$(basename $0)\$"); then + echo "$0: Cannot determine the PREFIX" >&2 + exit 1 +fi + +DB_POOL=/etc/dhcpdb.pool +DB_RELAY=/etc/dhcpdb.relay +DB_BIND=/var/db/dhcpdb.bind + +case "$1" in +start) + if [ -f ${DB_POOL} -a -f ${DB_RELAY} -a -x ${PREFIX}/sbin/dhcps ]; then + if [ -f ${DB_BIND} ]; then + find ${DB_POOL} -newer ${DB_BIND} -exec rm ${DB_BIND} \; + fi + ${PREFIX}/sbin/dhcps [Interface Name] + echo -n ' dhcps' + fi + ;; +stop) + killall dhcps && echo -n ' dhcps' + ;; +*) + echo "Usage: `basename $0` {start|stop}" >&2 + ;; +esac + +exit 0 diff --git a/net/zephyr/files/zhm.sh b/net/zephyr/files/zhm.sh index 155eefc2f349..c516ccd6adff 100644 --- a/net/zephyr/files/zhm.sh +++ b/net/zephyr/files/zhm.sh @@ -1,7 +1,19 @@ #!/bin/sh PREFIX=${PREFIX-/usr/local} -if [ -x ${PREFIX}/sbin/zhm -a -f ${PREFIX}/etc/zephyr/server.list ] ; then - PATH=${PREFIX}/sbin:${PREFIX}/bin:$PATH ; export PATH - zhm `cat ${PREFIX}/etc/zephyr/server.list` && echo -n ' zhm' -fi +case $1 in +start) + if [ -x ${PREFIX}/sbin/zhm -a -f ${PREFIX}/etc/zephyr/server.list ] ; then + PATH=${PREFIX}/sbin:${PREFIX}/bin:$PATH ; export PATH + zhm `cat ${PREFIX}/etc/zephyr/server.list` && echo -n ' zhm' + fi + ;; +stop) + ;; +*) + echo "Usage: `basename $0` {start|stop}" >&2 + exit 64 + ;; +esac + +exit 0 -- cgit v1.2.3