summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--audio/rplay/Makefile4
-rw-r--r--audio/rplay/files/rplayd.sh20
-rw-r--r--chinese/xemacs/files/xemacs20.sh31
-rw-r--r--comms/conserver/Makefile7
-rw-r--r--comms/conserver/files/conserver.sh22
-rw-r--r--comms/conserver/files/conserver.sh.in22
-rw-r--r--comms/hylafax/files/hylafax.sh.sample20
-rw-r--r--comms/qpage/Makefile5
-rw-r--r--comms/qpage/files/qpage.sh20
-rw-r--r--databases/msql/Makefile5
-rw-r--r--databases/msql/files/msql2.sh20
-rw-r--r--databases/msql3/Makefile5
-rw-r--r--databases/msql3/files/msql2.sh20
-rw-r--r--databases/mysql322-server/files/mysql-server.sh2
-rw-r--r--databases/mysql323-server/files/mysql-server.sh2
-rw-r--r--databases/mysql40-server/files/mysql-server.sh2
-rw-r--r--databases/mysql41-server/files/mysql-server.sh2
-rw-r--r--databases/mysql50-server/files/mysql-server.sh2
-rw-r--r--databases/mysql51-server/files/mysql-server.sh2
-rw-r--r--databases/mysql54-server/files/mysql-server.sh2
-rw-r--r--databases/mysql55-server/files/mysql-server.sh2
-rw-r--r--databases/mysql60-server/files/mysql-server.sh2
-rw-r--r--databases/percona55-server/files/mysql-server.sh2
-rw-r--r--dns/dhid/Makefile4
-rw-r--r--dns/dhid/files/dhid.sh20
-rw-r--r--editors/emacs/files/emacs.sh27
-rw-r--r--editors/emacs19/files/emacs.sh27
-rw-r--r--editors/emacs22/files/emacs.sh27
-rw-r--r--editors/emacs23/files/emacs.sh27
-rw-r--r--editors/mule-common/Makefile11
-rw-r--r--editors/mule-common/files/mule.sh21
-rw-r--r--editors/xemacs-devel/files/xemacs21.sh30
-rw-r--r--editors/xemacs/files/xemacs21.sh30
-rw-r--r--editors/xemacs20/files/xemacs20.sh30
-rw-r--r--editors/xemacs21/files/xemacs21.sh30
-rw-r--r--emulators/rtc/files/rtc.sh19
-rw-r--r--games/bnetd/Makefile5
-rw-r--r--games/bnetd/files/bnetd.sh20
-rw-r--r--games/quakeserver/Makefile13
-rw-r--r--games/quakeserver/files/quakeserver.sh21
-rw-r--r--games/tetrinet-x/files/tetrinet-x.sh18
-rw-r--r--games/uox3/files/uox3.sh21
-rw-r--r--irc/irc/Makefile5
-rw-r--r--irc/irc/files/ircd.sh15
-rw-r--r--irc/ircd-hybrid/files/ircd.sh19
-rw-r--r--japanese/Canna/files/canna.sh.in29
-rw-r--r--japanese/FreeWnn-server/pkg-install44
-rw-r--r--japanese/Wnn6/pkg-install18
-rw-r--r--japanese/canna-lib/files/canna.sh.in29
-rw-r--r--japanese/canna-server/files/canna.sh.in29
-rw-r--r--japanese/ebw3/files/ebw3d.sh.sample22
-rw-r--r--japanese/elvis/Makefile17
-rw-r--r--japanese/elvis/files/ja-elvis.sh25
-rw-r--r--japanese/esecanna/files/esecanna.sh52
-rw-r--r--japanese/postgresql-tcltk/files/pgsql.sh.tmpl26
-rw-r--r--japanese/postgresql/files/pgsql.sh.tmpl26
-rw-r--r--japanese/postgresql7/files/pgsql.sh.tmpl26
-rw-r--r--japanese/sj3-lib/Makefile8
-rw-r--r--japanese/sj3-lib/files/sj3.sh.in22
-rw-r--r--japanese/sj3-server/Makefile8
-rw-r--r--japanese/sj3-server/files/sj3.sh.in22
-rw-r--r--japanese/sj3/Makefile8
-rw-r--r--japanese/sj3/files/sj3.sh.in22
-rw-r--r--korean/hanemacs/files/emacs.sh27
-rw-r--r--lang/modula-3-lib/Makefile6
-rw-r--r--lang/modula-3-lib/files/50.m3.sh20
-rw-r--r--mail/exim-devel/files/exim.sh16
-rw-r--r--mail/exim-old/files/exim.sh16
-rw-r--r--mail/exim/files/exim.sh16
-rw-r--r--mail/youbin/files/youbind.sh.sample19
-rw-r--r--mail/zmailer/Makefile11
-rw-r--r--mail/zmailer/files/zmailer.sh.sample23
-rw-r--r--misc/dnetc/files/dnetc.sh49
-rw-r--r--misc/proxyper/files/proxyper.sh17
-rw-r--r--net-mgmt/arpwatch-devel/files/arpwatch.sh20
-rw-r--r--net-mgmt/arpwatch/files/arpwatch.sh20
-rw-r--r--net-mgmt/net-snmp-devel/Makefile4
-rw-r--r--net-mgmt/net-snmp-devel/files/snmpd.sh.sample20
-rw-r--r--net-mgmt/net-snmp/Makefile4
-rw-r--r--net-mgmt/net-snmp/files/snmpd.sh.sample20
-rw-r--r--net-mgmt/net-snmp4/Makefile4
-rw-r--r--net-mgmt/net-snmp4/files/snmpd.sh.sample20
-rw-r--r--net-mgmt/net-snmp53/Makefile4
-rw-r--r--net-mgmt/net-snmp53/files/snmpd.sh.sample20
-rw-r--r--net-mgmt/wide-dhcp/Makefile20
-rw-r--r--net-mgmt/wide-dhcp/files/wide-dhcps.sh.sample30
-rw-r--r--net/arpwatch-devel/files/arpwatch.sh20
-rw-r--r--net/arpwatch/files/arpwatch.sh20
-rw-r--r--net/dhid/Makefile4
-rw-r--r--net/dhid/files/dhid.sh20
-rw-r--r--net/generic-nqs/files/nqs.sh21
-rw-r--r--net/gnu-finger/files/fingerd.sh.sample22
-rw-r--r--net/net-snmp/Makefile4
-rw-r--r--net/net-snmp/files/snmpd.sh.sample20
-rw-r--r--net/net-snmp4/Makefile4
-rw-r--r--net/net-snmp4/files/snmpd.sh.sample20
-rw-r--r--net/poptop/files/pptpd.sh16
-rw-r--r--net/priss/files/qtss.sh16
-rw-r--r--net/rwhois/Makefile9
-rw-r--r--net/rwhois/files/rwhoisd.sh23
-rw-r--r--net/rwhoisd/Makefile9
-rw-r--r--net/rwhoisd/files/rwhoisd.sh23
-rw-r--r--net/tac_plus4/Makefile4
-rw-r--r--net/tac_plus4/files/tac_plus.sh20
-rw-r--r--net/tcserver/Makefile4
-rw-r--r--net/tdetect/Makefile5
-rw-r--r--net/tdetect/files/tdetect.sh22
-rw-r--r--net/ucd-snmp/Makefile4
-rw-r--r--net/ucd-snmp/files/snmpd.sh.sample20
-rw-r--r--net/wide-dhcp/Makefile20
-rw-r--r--net/wide-dhcp/files/wide-dhcps.sh.sample30
-rw-r--r--net/zephyr/files/zhm.sh20
-rw-r--r--news/diablo/scripts/diablo.sh18
-rw-r--r--news/diablo/scripts/diablo.sh-sample18
-rw-r--r--news/dnews/files/dnews.sh24
-rw-r--r--russian/apache13/Makefile4
-rw-r--r--russian/apache13/files/apache.sh20
-rw-r--r--security/xinetd/Makefile6
-rw-r--r--security/xinetd/files/xinetd.sh22
-rw-r--r--sysutils/healthd/Makefile4
-rw-r--r--sysutils/syslog-ng/Makefile4
-rw-r--r--sysutils/syslog-ng/files/syslog-ng.sh.sample20
-rw-r--r--sysutils/syslog-ng1/Makefile4
-rw-r--r--sysutils/syslog-ng1/files/syslog-ng.sh.sample20
-rw-r--r--sysutils/upsmon/files/upsmon.sh21
-rw-r--r--textproc/coco/Makefile11
-rw-r--r--textproc/coco/files/mule.sh21
-rw-r--r--www/adzapper/files/rc.adzapper.sh21
-rw-r--r--www/apache13+ipv6/Makefile4
-rw-r--r--www/apache13+ipv6/files/apache.sh20
-rw-r--r--www/apache13-modssl/files/apache.sh20
-rw-r--r--www/apache13/Makefile4
-rw-r--r--www/apache13/files/apache.sh20
-rw-r--r--www/apache2/Makefile4
-rw-r--r--www/apache2/files/apache.sh20
-rw-r--r--www/apache20/Makefile4
-rw-r--r--www/apache20/files/apache.sh20
-rw-r--r--www/apache21/Makefile4
-rw-r--r--www/apache21/files/apache.sh20
-rw-r--r--www/apache22/Makefile4
-rw-r--r--www/apache22/files/apache.sh20
-rw-r--r--www/httptunnel/files/httptunnel.sh46
-rw-r--r--www/junkbuster-zlib/files/junkbuster.sh.in22
-rw-r--r--www/junkbuster/files/junkbuster.sh.in22
-rw-r--r--www/mathopd/Makefile4
-rw-r--r--www/mathopd/files/mathopd.sh20
-rw-r--r--www/roxen/files/roxen.sh.in20
-rw-r--r--www/squid/Makefile6
-rw-r--r--www/squid/files/squid.sh21
-rw-r--r--www/squid22/Makefile6
-rw-r--r--www/squid22/files/squid.sh21
-rw-r--r--www/squid23/Makefile6
-rw-r--r--www/squid23/files/squid.sh21
-rw-r--r--www/squid24/Makefile6
-rw-r--r--www/squid24/files/squid.sh21
-rw-r--r--www/squid25/Makefile6
-rw-r--r--www/squid25/files/squid.sh21
-rw-r--r--www/squid26/Makefile6
-rw-r--r--www/squid26/files/squid.sh21
-rw-r--r--www/squid27/Makefile6
-rw-r--r--www/squid27/files/squid.sh21
-rw-r--r--www/squid30/Makefile6
-rw-r--r--www/squid30/files/squid.sh21
-rw-r--r--www/squid31/Makefile6
-rw-r--r--www/squid31/files/squid.sh21
-rw-r--r--www/thttpd/Makefile4
-rw-r--r--www/thttpd/files/thttpd.sh20
-rw-r--r--www/wwwoffle/files/wwwoffled.sh17
-rw-r--r--www/zope/Makefile5
-rw-r--r--www/zope/files/zope.sh.in17
-rw-r--r--www/zope210/Makefile5
-rw-r--r--www/zope210/files/zope.sh.in17
-rw-r--r--www/zope211/Makefile5
-rw-r--r--www/zope211/files/zope.sh.in17
-rw-r--r--www/zope213/Makefile5
-rw-r--r--www/zope213/files/zope.sh.in17
-rw-r--r--www/zope28/Makefile5
-rw-r--r--www/zope28/files/zope.sh.in17
-rw-r--r--www/zope29/Makefile5
-rw-r--r--www/zope29/files/zope.sh.in17
180 files changed, 2259 insertions, 593 deletions
diff --git a/audio/rplay/Makefile b/audio/rplay/Makefile
index 88ee5e94d2cd..84884e531156 100644
--- a/audio/rplay/Makefile
+++ b/audio/rplay/Makefile
@@ -34,9 +34,7 @@ post-install:
.endfor
.if !exists(${PREFIX}/etc/rc.d/rplayd.sh)
@${ECHO} "===> Installing ${PREFIX}/etc/rc.d/rplayd.sh startup file"
- @${ECHO} "#!/bin/sh" > ${PREFIX}/etc/rc.d/rplayd.sh
- @${ECHO} "[ -x ${PREFIX}/sbin/rplayd ] && ( ${PREFIX}/sbin/rplayd & ) && ${ECHO} -n ' rplayd'" >> ${PREFIX}/etc/rc.d/rplayd.sh
- @${CHMOD} 751 ${PREFIX}/etc/rc.d/rplayd.sh
+ @${INSTALL_SCRIPT} -m 751 ${FILESDIR}/rplayd.sh ${PREFIX}/etc/rc.d/rplayd.sh
.endif
.if !exists(${PREFIX}/etc/rplay.hosts)
@${ECHO} localhost > ${PREFIX}/etc/rplay.hosts
diff --git a/audio/rplay/files/rplayd.sh b/audio/rplay/files/rplayd.sh
new file mode 100644
index 000000000000..ffce002a43eb
--- /dev/null
+++ b/audio/rplay/files/rplayd.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/rplayd ] && ( ${PREFIX}/sbin/rplayd & ) && echo -n ' rplayd'
+ ;;
+stop)
+ killall rplayd && echo -n ' rplayd'
+ ;;
+*)
+ echo "Usage: `basename $0` {start|stop}" >&2
+ ;;
+esac
+
+exit 0
diff --git a/chinese/xemacs/files/xemacs20.sh b/chinese/xemacs/files/xemacs20.sh
index 80166e668d5f..a728759dc877 100644
--- a/chinese/xemacs/files/xemacs20.sh
+++ b/chinese/xemacs/files/xemacs20.sh
@@ -2,13 +2,26 @@
# script to create the lock directory in case it was
# removed in /etc/rc
#echo -n ' Xemacs'
-if [ -d /var/run/emacs/lock ]
-then
-# delete any junk which may have been left around
- rm -f /var/run/emacs/lock/*
-else
- mkdir -p /var/run/emacs/lock
-fi
-# can always do this
-chmod 1777 /var/run/emacs/lock
+
+case $1 in
+start)
+ if [ -d /var/run/emacs/lock ]
+ then
+ # delete any junk which may have been left around
+ rm -f /var/run/emacs/lock/*
+ else
+ mkdir -p /var/run/emacs/lock
+ fi
+ # can always do this
+ chmod 1777 /var/run/emacs/lock
+ ;;
+stop)
+ # nothing to do
+ ;;
+*)
+ echo "Usage: `basename $0` {start|stop}" >&2
+ exit 64
+ ;;
+esac
+
exit 0
diff --git a/comms/conserver/Makefile b/comms/conserver/Makefile
index e07cc9a78909..4ab1c30a28ba 100644
--- a/comms/conserver/Makefile
+++ b/comms/conserver/Makefile
@@ -37,11 +37,8 @@ post-extract:
post-install:
@if [ ! -f ${PREFIX}/etc/rc.d/conserver.sh ]; then \
${ECHO} "Installing ${PREFIX}/etc/rc.d/conserver.sh startup file."; \
- ${ECHO} "#!/bin/sh" > ${PREFIX}/etc/rc.d/conserver.sh; \
- ${ECHO} "if [ -x ${PREFIX}/sbin/conserver -a -f ${PREFIX}/etc/conserver.cf ]; then" >> ${PREFIX}/etc/rc.d/conserver.sh; \
- ${ECHO} " ${PREFIX}/sbin/conserver -d -n ; ${ECHO} -n ' conserver'" >> ${PREFIX}/etc/rc.d/conserver.sh; \
- ${ECHO} "fi" >> ${PREFIX}/etc/rc.d/conserver.sh; \
- ${CHMOD} 751 ${PREFIX}/etc/rc.d/conserver.sh; \
+ ${INSTALL_SCRIPT} -m 751 ${FILESDIR}/conserver.sh \
+ ${PREFIX}/etc/rc.d/conserver.sh; \
fi
.include <bsd.port.mk>
diff --git a/comms/conserver/files/conserver.sh b/comms/conserver/files/conserver.sh
new file mode 100644
index 000000000000..842c39e60400
--- /dev/null
+++ b/comms/conserver/files/conserver.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
+
+case "$1" in
+start)
+ if [ -x ${PREFIX}/sbin/conserver -a -f ${PREFIX}/etc/conserver.cf ]; then
+ ${PREFIX}/sbin/conserver -d -n ; echo -n ' conserver'
+ fi
+ ;;
+stop)
+ killall conserver && echo -n ' conserver'
+ ;;
+*)
+ echo "Usage: `basename $0` {start|stop}" >&2
+ ;;
+esac
+
+exit 0
diff --git a/comms/conserver/files/conserver.sh.in b/comms/conserver/files/conserver.sh.in
new file mode 100644
index 000000000000..842c39e60400
--- /dev/null
+++ b/comms/conserver/files/conserver.sh.in
@@ -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
+
+case "$1" in
+start)
+ if [ -x ${PREFIX}/sbin/conserver -a -f ${PREFIX}/etc/conserver.cf ]; then
+ ${PREFIX}/sbin/conserver -d -n ; echo -n ' conserver'
+ fi
+ ;;
+stop)
+ killall conserver && echo -n ' conserver'
+ ;;
+*)
+ echo "Usage: `basename $0` {start|stop}" >&2
+ ;;
+esac
+
+exit 0
diff --git a/comms/hylafax/files/hylafax.sh.sample b/comms/hylafax/files/hylafax.sh.sample
index 069ac04e1686..f7a0f61200e3 100644
--- a/comms/hylafax/files/hylafax.sh.sample
+++ b/comms/hylafax/files/hylafax.sh.sample
@@ -4,6 +4,20 @@
# server: /usr/local/sbin/faxsetup
# modems: /usr/local/sbin/faxaddmodem
# incoming calls: /etc/ttys
-if [ -x /usr/local/sbin/faxq ]; then
- /usr/local/sbin/faxq && echo -n ' hylafax'
-fi
+
+case "$1" in
+start)
+ if [ -x /usr/local/sbin/faxq ]; then
+ /usr/local/sbin/faxq && echo -n ' hylafax'
+ fi
+ ;;
+stop)
+ killall faxq && echo -n ' hylafax'
+ ;;
+*)
+ echo "Usage: `basename $0` {start|stop}" >&2
+ exit 64
+ ;;
+esac
+
+exit 0
diff --git a/comms/qpage/Makefile b/comms/qpage/Makefile
index 2d144e0659d1..e80b620fd93f 100644
--- a/comms/qpage/Makefile
+++ b/comms/qpage/Makefile
@@ -20,9 +20,8 @@ MAN1= qpage.1
post-install:
@if [ ! -f ${PREFIX}/etc/rc.d/qpage.sh ]; then \
${ECHO} "Install ${PREFIX}/etc/rc.d/qpage.sh startup file."; \
- ${ECHO} "#!/bin/sh" > ${PREFIX}/etc/rc.d/qpage.sh; \
- ${ECHO} "[ -x ${PREFIX}/bin/qpage ] && ${PREFIX}/bin/qpage -q10 && ${ECHO} -n ' qpage'" >> ${PREFIX}/etc/rc.d/qpage.sh; \
- ${CHMOD} 751 ${PREFIX}/etc/rc.d/qpage.sh; \
+ ${INSTALL_SCRIPT} -m 751 ${FILESDIR}/qpage.sh \
+ ${PREFIX}/etc/rc.d/qpage.sh \
fi
.include <bsd.port.mk>
diff --git a/comms/qpage/files/qpage.sh b/comms/qpage/files/qpage.sh
new file mode 100644
index 000000000000..a183fa095842
--- /dev/null
+++ b/comms/qpage/files/qpage.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}/bin/qpage ] && ${PREFIX}/bin/qpage -q10 && echo -n ' qpage'
+ ;;
+stop)
+ killall qpage && echo -n ' qpage'
+ ;;
+*)
+ echo "Usage: `basename $0` {start|stop}" >&2
+ ;;
+esac
+
+exit 0
diff --git a/databases/msql/Makefile b/databases/msql/Makefile
index b57040a46b60..03b9d8a503e3 100644
--- a/databases/msql/Makefile
+++ b/databases/msql/Makefile
@@ -44,9 +44,8 @@ post-install:
@${MKDIR} ${PREFIX}/etc/rc.d
@if [ ! -f ${PREFIX}/etc/rc.d/msql2.sh ]; then \
${ECHO} "Installing ${PREFIX}/etc/rc.d/msql2.sh startup file."; \
- ${ECHO} "#!/bin/sh" > ${PREFIX}/etc/rc.d/msql2.sh; \
- ${ECHO} "[ -x ${PREFIX}/bin/msql2d ] && su -l msql -c 'exec ${PREFIX}/bin/msql2d' > /dev/null 2>&1 & && ${ECHO} -n ' msql2'" >> ${PREFIX}/etc/rc.d/msql2.sh; \
- ${CHMOD} 751 ${PREFIX}/etc/rc.d/msql2.sh; \
+ ${INSTALL_SCRIPT} -m 751 ${FILESDIR}/msql2d.sh \
+ ${PREFIX}/etc/rc.d/msql2d.sh; \
fi
.if !defined(BATCH)
@ /usr/bin/more -e ${FILESDIR}/post-install-notes
diff --git a/databases/msql/files/msql2.sh b/databases/msql/files/msql2.sh
new file mode 100644
index 000000000000..4f9ff5c87c16
--- /dev/null
+++ b/databases/msql/files/msql2.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}/bin/msql2d ] && su -l msql -c 'exec ${PREFIX}/bin/msql2d' > /dev/null 2>&1 & && echo -n ' msql2'
+ ;;
+stop)
+ killall msql2d && echo -n ' msql2d'
+ ;;
+*)
+ echo "Usage: `basename $0` {start|stop}" >&2
+ ;;
+esac
+
+exit 0
diff --git a/databases/msql3/Makefile b/databases/msql3/Makefile
index b57040a46b60..03b9d8a503e3 100644
--- a/databases/msql3/Makefile
+++ b/databases/msql3/Makefile
@@ -44,9 +44,8 @@ post-install:
@${MKDIR} ${PREFIX}/etc/rc.d
@if [ ! -f ${PREFIX}/etc/rc.d/msql2.sh ]; then \
${ECHO} "Installing ${PREFIX}/etc/rc.d/msql2.sh startup file."; \
- ${ECHO} "#!/bin/sh" > ${PREFIX}/etc/rc.d/msql2.sh; \
- ${ECHO} "[ -x ${PREFIX}/bin/msql2d ] && su -l msql -c 'exec ${PREFIX}/bin/msql2d' > /dev/null 2>&1 & && ${ECHO} -n ' msql2'" >> ${PREFIX}/etc/rc.d/msql2.sh; \
- ${CHMOD} 751 ${PREFIX}/etc/rc.d/msql2.sh; \
+ ${INSTALL_SCRIPT} -m 751 ${FILESDIR}/msql2d.sh \
+ ${PREFIX}/etc/rc.d/msql2d.sh; \
fi
.if !defined(BATCH)
@ /usr/bin/more -e ${FILESDIR}/post-install-notes
diff --git a/databases/msql3/files/msql2.sh b/databases/msql3/files/msql2.sh
new file mode 100644
index 000000000000..4f9ff5c87c16
--- /dev/null
+++ b/databases/msql3/files/msql2.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}/bin/msql2d ] && su -l msql -c 'exec ${PREFIX}/bin/msql2d' > /dev/null 2>&1 & && echo -n ' msql2'
+ ;;
+stop)
+ killall msql2d && echo -n ' msql2d'
+ ;;
+*)
+ echo "Usage: `basename $0` {start|stop}" >&2
+ ;;
+esac
+
+exit 0
diff --git a/databases/mysql322-server/files/mysql-server.sh b/databases/mysql322-server/files/mysql-server.sh
index 507a080ec911..0ff5374c48f7 100644
--- a/databases/mysql322-server/files/mysql-server.sh
+++ b/databases/mysql322-server/files/mysql-server.sh
@@ -13,6 +13,6 @@ case "$1" in
echo ""
echo "Usage: `basename $0` { start | stop }"
echo ""
- exit 1
+ exit 64
;;
esac
diff --git a/databases/mysql323-server/files/mysql-server.sh b/databases/mysql323-server/files/mysql-server.sh
index 507a080ec911..0ff5374c48f7 100644
--- a/databases/mysql323-server/files/mysql-server.sh
+++ b/databases/mysql323-server/files/mysql-server.sh
@@ -13,6 +13,6 @@ case "$1" in
echo ""
echo "Usage: `basename $0` { start | stop }"
echo ""
- exit 1
+ exit 64
;;
esac
diff --git a/databases/mysql40-server/files/mysql-server.sh b/databases/mysql40-server/files/mysql-server.sh
index 507a080ec911..0ff5374c48f7 100644
--- a/databases/mysql40-server/files/mysql-server.sh
+++ b/databases/mysql40-server/files/mysql-server.sh
@@ -13,6 +13,6 @@ case "$1" in
echo ""
echo "Usage: `basename $0` { start | stop }"
echo ""
- exit 1
+ exit 64
;;
esac
diff --git a/databases/mysql41-server/files/mysql-server.sh b/databases/mysql41-server/files/mysql-server.sh
index 507a080ec911..0ff5374c48f7 100644
--- a/databases/mysql41-server/files/mysql-server.sh
+++ b/databases/mysql41-server/files/mysql-server.sh
@@ -13,6 +13,6 @@ case "$1" in
echo ""
echo "Usage: `basename $0` { start | stop }"
echo ""
- exit 1
+ exit 64
;;
esac
diff --git a/databases/mysql50-server/files/mysql-server.sh b/databases/mysql50-server/files/mysql-server.sh
index 507a080ec911..0ff5374c48f7 100644
--- a/databases/mysql50-server/files/mysql-server.sh
+++ b/databases/mysql50-server/files/mysql-server.sh
@@ -13,6 +13,6 @@ case "$1" in
echo ""
echo "Usage: `basename $0` { start | stop }"
echo ""
- exit 1
+ exit 64
;;
esac
diff --git a/databases/mysql51-server/files/mysql-server.sh b/databases/mysql51-server/files/mysql-server.sh
index 507a080ec911..0ff5374c48f7 100644
--- a/databases/mysql51-server/files/mysql-server.sh
+++ b/databases/mysql51-server/files/mysql-server.sh
@@ -13,6 +13,6 @@ case "$1" in
echo ""
echo "Usage: `basename $0` { start | stop }"
echo ""
- exit 1
+ exit 64
;;
esac
diff --git a/databases/mysql54-server/files/mysql-server.sh b/databases/mysql54-server/files/mysql-server.sh
index 507a080ec911..0ff5374c48f7 100644
--- a/databases/mysql54-server/files/mysql-server.sh
+++ b/databases/mysql54-server/files/mysql-server.sh
@@ -13,6 +13,6 @@ case "$1" in
echo ""
echo "Usage: `basename $0` { start | stop }"
echo ""
- exit 1
+ exit 64
;;
esac
diff --git a/databases/mysql55-server/files/mysql-server.sh b/databases/mysql55-server/files/mysql-server.sh
index 507a080ec911..0ff5374c48f7 100644
--- a/databases/mysql55-server/files/mysql-server.sh
+++ b/databases/mysql55-server/files/mysql-server.sh
@@ -13,6 +13,6 @@ case "$1" in
echo ""
echo "Usage: `basename $0` { start | stop }"
echo ""
- exit 1
+ exit 64
;;
esac
diff --git a/databases/mysql60-server/files/mysql-server.sh b/databases/mysql60-server/files/mysql-server.sh
index 507a080ec911..0ff5374c48f7 100644
--- a/databases/mysql60-server/files/mysql-server.sh
+++ b/databases/mysql60-server/files/mysql-server.sh
@@ -13,6 +13,6 @@ case "$1" in
echo ""
echo "Usage: `basename $0` { start | stop }"
echo ""
- exit 1
+ exit 64
;;
esac
diff --git a/databases/percona55-server/files/mysql-server.sh b/databases/percona55-server/files/mysql-server.sh
index 507a080ec911..0ff5374c48f7 100644
--- a/databases/percona55-server/files/mysql-server.sh
+++ b/databases/percona55-server/files/mysql-server.sh
@@ -13,6 +13,6 @@ case "$1" in
echo ""
echo "Usage: `basename $0` { start | stop }"
echo ""
- exit 1
+ exit 64
;;
esac
diff --git a/dns/dhid/Makefile b/dns/dhid/Makefile
index 622c66866d7b..e01835a2e849 100644
--- a/dns/dhid/Makefile
+++ b/dns/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/dns/dhid/files/dhid.sh b/dns/dhid/files/dhid.sh
new file mode 100644
index 000000000000..510f4ab70d16
--- /dev/null
+++ b/dns/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/editors/emacs/files/emacs.sh b/editors/emacs/files/emacs.sh
index 09baabfd255c..c6976c1b8a18 100644
--- a/editors/emacs/files/emacs.sh
+++ b/editors/emacs/files/emacs.sh
@@ -1,10 +1,21 @@
#!/bin/sh
-if [ -d /var/run/emacs/lock ]
-then
- rm -f /var/run/emacs/lock/*
-else
- mkdir -p /var/run/emacs/lock
-fi
-chmod 1777 /var/run/emacs/lock
-exit 0
+case "$1" in
+start)
+ if [ -d /var/run/emacs/lock ]
+ then
+ rm -f /var/run/emacs/lock/*
+ else
+ mkdir -p /var/run/emacs/lock
+ fi
+ chmod 1777 /var/run/emacs/lock
+ ;;
+stop)
+ ;;
+*)
+ echo "Usage: `basename $0` {start|stop}" >&2
+ exit 64
+ ;;
+esac
+
+exit 0
diff --git a/editors/emacs19/files/emacs.sh b/editors/emacs19/files/emacs.sh
index 09baabfd255c..c6976c1b8a18 100644
--- a/editors/emacs19/files/emacs.sh
+++ b/editors/emacs19/files/emacs.sh
@@ -1,10 +1,21 @@
#!/bin/sh
-if [ -d /var/run/emacs/lock ]
-then
- rm -f /var/run/emacs/lock/*
-else
- mkdir -p /var/run/emacs/lock
-fi
-chmod 1777 /var/run/emacs/lock
-exit 0
+case "$1" in
+start)
+ if [ -d /var/run/emacs/lock ]
+ then
+ rm -f /var/run/emacs/lock/*
+ else
+ mkdir -p /var/run/emacs/lock
+ fi
+ chmod 1777 /var/run/emacs/lock
+ ;;
+stop)
+ ;;
+*)
+ echo "Usage: `basename $0` {start|stop}" >&2
+ exit 64
+ ;;
+esac
+
+exit 0
diff --git a/editors/emacs22/files/emacs.sh b/editors/emacs22/files/emacs.sh
index 09baabfd255c..c6976c1b8a18 100644
--- a/editors/emacs22/files/emacs.sh
+++ b/editors/emacs22/files/emacs.sh
@@ -1,10 +1,21 @@
#!/bin/sh
-if [ -d /var/run/emacs/lock ]
-then
- rm -f /var/run/emacs/lock/*
-else
- mkdir -p /var/run/emacs/lock
-fi
-chmod 1777 /var/run/emacs/lock
-exit 0
+case "$1" in
+start)
+ if [ -d /var/run/emacs/lock ]
+ then
+ rm -f /var/run/emacs/lock/*
+ else
+ mkdir -p /var/run/emacs/lock
+ fi
+ chmod 1777 /var/run/emacs/lock
+ ;;
+stop)
+ ;;
+*)
+ echo "Usage: `basename $0` {start|stop}" >&2
+ exit 64
+ ;;
+esac
+
+exit 0
diff --git a/editors/emacs23/files/emacs.sh b/editors/emacs23/files/emacs.sh
index 09baabfd255c..c6976c1b8a18 100644
--- a/editors/emacs23/files/emacs.sh
+++ b/editors/emacs23/files/emacs.sh
@@ -1,10 +1,21 @@
#!/bin/sh
-if [ -d /var/run/emacs/lock ]
-then
- rm -f /var/run/emacs/lock/*
-else
- mkdir -p /var/run/emacs/lock
-fi
-chmod 1777 /var/run/emacs/lock
-exit 0
+case "$1" in
+start)
+ if [ -d /var/run/emacs/lock ]
+ then
+ rm -f /var/run/emacs/lock/*
+ else
+ mkdir -p /var/run/emacs/lock
+ fi
+ chmod 1777 /var/run/emacs/lock
+ ;;
+stop)
+ ;;
+*)
+ echo "Usage: `basename $0` {start|stop}" >&2
+ exit 64
+ ;;
+esac
+
+exit 0
diff --git a/editors/mule-common/Makefile b/editors/mule-common/Makefile
index c8f15a0f428b..96f31f66cd13 100644
--- a/editors/mule-common/Makefile
+++ b/editors/mule-common/Makefile
@@ -152,16 +152,7 @@ post-install:
@${TOUCH} ${TOUCH_FLAGS} ${INSTALL_COOKIE}
if [ ! -f ${STARTUP_SCRIPT} ]; then \
${ECHO} "Installing ${STARTUP_SCRIPT} startup file."; \
- ${ECHO} '#!/bin/sh' > ${STARTUP_SCRIPT}; \
- ${ECHO} '#${ECHO} -n " Mule"' >> ${STARTUP_SCRIPT}; \
- ${ECHO} 'if [ -d /var/run/emacs/lock ]; then' >> ${STARTUP_SCRIPT}; \
- ${ECHO} ' rm -f /var/run/emacs/lock/*' >> ${STARTUP_SCRIPT}; \
- ${ECHO} "else" >> ${STARTUP_SCRIPT}; \
- ${ECHO} " mkdir -p /var/run/emacs/lock" >> ${STARTUP_SCRIPT}; \
- ${ECHO} "fi" >> ${STARTUP_SCRIPT} ; \
- ${ECHO} "${CHMOD} 1777 /var/run/emacs/lock${lockdir}" >> ${STARTUP_SCRIPT} ; \
- ${CHMOD} 755 ${STARTUP_SCRIPT} ; \
- ${CHOWN} bin.bin ${STARTUP_SCRIPT}; \
+ ${INSTALL_SCRIPT} ${FILESDIR}/mule.sh ${STARTUPSCRIPT}; \
fi
post-package:
diff --git a/editors/mule-common/files/mule.sh b/editors/mule-common/files/mule.sh
new file mode 100644
index 000000000000..c6976c1b8a18
--- /dev/null
+++ b/editors/mule-common/files/mule.sh
@@ -0,0 +1,21 @@
+#!/bin/sh
+
+case "$1" in
+start)
+ if [ -d /var/run/emacs/lock ]
+ then
+ rm -f /var/run/emacs/lock/*
+ else
+ mkdir -p /var/run/emacs/lock
+ fi
+ chmod 1777 /var/run/emacs/lock
+ ;;
+stop)
+ ;;
+*)
+ echo "Usage: `basename $0` {start|stop}" >&2
+ exit 64
+ ;;
+esac
+
+exit 0
diff --git a/editors/xemacs-devel/files/xemacs21.sh b/editors/xemacs-devel/files/xemacs21.sh
index 80166e668d5f..7c4961579079 100644
--- a/editors/xemacs-devel/files/xemacs21.sh
+++ b/editors/xemacs-devel/files/xemacs21.sh
@@ -2,13 +2,25 @@
# script to create the lock directory in case it was
# removed in /etc/rc
#echo -n ' Xemacs'
-if [ -d /var/run/emacs/lock ]
-then
-# delete any junk which may have been left around
- rm -f /var/run/emacs/lock/*
-else
- mkdir -p /var/run/emacs/lock
-fi
-# can always do this
-chmod 1777 /var/run/emacs/lock
+
+case "$1" in
+start)
+ if [ -d /var/run/emacs/lock ]
+ then
+ # delete any junk which may have been left around
+ rm -f /var/run/emacs/lock/*
+ else
+ mkdir -p /var/run/emacs/lock
+ fi
+ # can always do this
+ chmod 1777 /var/run/emacs/lock
+ ;;
+stop)
+ ;;
+*)
+ echo "Usage: `basename $0` {start|stop}" >&2
+ exit 64
+ ;;
+esac
+
exit 0
diff --git a/editors/xemacs/files/xemacs21.sh b/editors/xemacs/files/xemacs21.sh
index 80166e668d5f..7c4961579079 100644
--- a/editors/xemacs/files/xemacs21.sh
+++ b/editors/xemacs/files/xemacs21.sh
@@ -2,13 +2,25 @@
# script to create the lock directory in case it was
# removed in /etc/rc
#echo -n ' Xemacs'
-if [ -d /var/run/emacs/lock ]
-then
-# delete any junk which may have been left around
- rm -f /var/run/emacs/lock/*
-else
- mkdir -p /var/run/emacs/lock
-fi
-# can always do this
-chmod 1777 /var/run/emacs/lock
+
+case "$1" in
+start)
+ if [ -d /var/run/emacs/lock ]
+ then
+ # delete any junk which may have been left around
+ rm -f /var/run/emacs/lock/*
+ else
+ mkdir -p /var/run/emacs/lock
+ fi
+ # can always do this
+ chmod 1777 /var/run/emacs/lock
+ ;;
+stop)
+ ;;
+*)
+ echo "Usage: `basename $0` {start|stop}" >&2
+ exit 64
+ ;;
+esac
+
exit 0
diff --git a/editors/xemacs20/files/xemacs20.sh b/editors/xemacs20/files/xemacs20.sh
index 80166e668d5f..7c4961579079 100644
--- a/editors/xemacs20/files/xemacs20.sh
+++ b/editors/xemacs20/files/xemacs20.sh
@@ -2,13 +2,25 @@
# script to create the lock directory in case it was
# removed in /etc/rc
#echo -n ' Xemacs'
-if [ -d /var/run/emacs/lock ]
-then
-# delete any junk which may have been left around
- rm -f /var/run/emacs/lock/*
-else
- mkdir -p /var/run/emacs/lock
-fi
-# can always do this
-chmod 1777 /var/run/emacs/lock
+
+case "$1" in
+start)
+ if [ -d /var/run/emacs/lock ]
+ then
+ # delete any junk which may have been left around
+ rm -f /var/run/emacs/lock/*
+ else
+ mkdir -p /var/run/emacs/lock
+ fi
+ # can always do this
+ chmod 1777 /var/run/emacs/lock
+ ;;
+stop)
+ ;;
+*)
+ echo "Usage: `basename $0` {start|stop}" >&2
+ exit 64
+ ;;
+esac
+
exit 0
diff --git a/editors/xemacs21/files/xemacs21.sh b/editors/xemacs21/files/xemacs21.sh
index 80166e668d5f..7c4961579079 100644
--- a/editors/xemacs21/files/xemacs21.sh
+++ b/editors/xemacs21/files/xemacs21.sh
@@ -2,13 +2,25 @@
# script to create the lock directory in case it was
# removed in /etc/rc
#echo -n ' Xemacs'
-if [ -d /var/run/emacs/lock ]
-then
-# delete any junk which may have been left around
- rm -f /var/run/emacs/lock/*
-else
- mkdir -p /var/run/emacs/lock
-fi
-# can always do this
-chmod 1777 /var/run/emacs/lock
+
+case "$1" in
+start)
+ if [ -d /var/run/emacs/lock ]
+ then
+ # delete any junk which may have been left around
+ rm -f /var/run/emacs/lock/*
+ else
+ mkdir -p /var/run/emacs/lock
+ fi
+ # can always do this
+ chmod 1777 /var/run/emacs/lock
+ ;;
+stop)
+ ;;
+*)
+ echo "Usage: `basename $0` {start|stop}" >&2
+ exit 64
+ ;;
+esac
+
exit 0
diff --git a/emulators/rtc/files/rtc.sh b/emulators/rtc/files/rtc.sh
index a39569c74ce3..5fa3843be1f4 100644
--- a/emulators/rtc/files/rtc.sh
+++ b/emulators/rtc/files/rtc.sh
@@ -2,7 +2,18 @@
kmod=@@PREFIX@@/modules/rtc.ko
-if [ -x $kmod ]; then
- echo -n ' rtc'
- kldload $kmod
-fi
+case "$1" in
+start)
+ if [ -x $kmod ]; then
+ echo -n ' rtc'
+ kldload $kmod
+ fi
+ ;;
+stop)
+ kldunload $kmod && echo -n ' rtc'
+ ;;
+*)
+ echo "Usage: `basename $0` {start|stop}" >&2
+ exit 64
+ ;;
+esac
diff --git a/games/bnetd/Makefile b/games/bnetd/Makefile
index a73fc13a43a6..8d90c2eb3236 100644
--- a/games/bnetd/Makefile
+++ b/games/bnetd/Makefile
@@ -32,9 +32,8 @@ do-install:
post-install:
@if [ ! -f ${PREFIX}/etc/rc.d/bnetd.sh ]; then \
${ECHO} "Installing ${PREFIX}/etc/rc.d/bnetd.sh startup file."; \
- ${ECHO} "#!/bin/sh" > ${PREFIX}/etc/rc.d/bnetd.sh; \
- ${ECHO} "cd ${PREFIX}; [ -x sbin/bnetd -a -f bnetd/conf/bnetd.conf ] && sbin/bnetd -c bnetd/conf/bnetd.conf > /dev/null && ${ECHO} -n ' bnetd'" >> ${PREFIX}/etc/rc.d/bnetd.sh; \
- ${CHMOD} 751 ${PREFIX}/etc/rc.d/bnetd.sh; \
+ ${INSTALL_SCRIPT} -m 751 ${FILESDIR}/bnetd.sh \
+ ${PREFIX}/etc/rc.d/bnetd.sh; \
fi
.include <bsd.port.mk>
diff --git a/games/bnetd/files/bnetd.sh b/games/bnetd/files/bnetd.sh
new file mode 100644
index 000000000000..fe9cf99c7164
--- /dev/null
+++ b/games/bnetd/files/bnetd.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)
+ cd ${PREFIX}; [ -x sbin/bnetd -a -f bnetd/conf/bnetd.conf ] && sbin/bnetd -c bnetd/conf/bnetd.conf > /dev/null && echo -n ' bnetd'
+ ;;
+stop)
+ killall bnetd && echo -n ' bnetd'
+ ;;
+*)
+ echo "Usage: `basename $0` {start|stop}" >&2
+ ;;
+esac
+
+exit 0
diff --git a/games/quakeserver/Makefile b/games/quakeserver/Makefile
index e9945f5895f7..56bde3349cac 100644
--- a/games/quakeserver/Makefile
+++ b/games/quakeserver/Makefile
@@ -32,9 +32,10 @@ do-extract:
do-configure:
@ ${CP} ${FILESDIR}/readme.port ${WRKSRC}
+ @ ${CP} ${FILESDIR}/quakeserver.sh ${WRKSRC}
@ ${CP} ${FILESDIR}/qserver.sh ${WRKSRC}
@ ${CP} ${FILESDIR}/stopserver.sh ${WRKSRC}
- @ ${SETENV} ${MAKE_ENV} ${PERL} -pi -e 's|%%PREFIX%%|${PREFIX}|g' ${WRKSRC}/readme.port ${WRKSRC}/qserver.sh ${WRKSRC}/stopserver.sh
+ @ ${SETENV} ${MAKE_ENV} ${PERL} -pi -e 's|%%PREFIX%%|${PREFIX}|g' ${WRKSRC}/readme.port ${WRKSRC}/quakeserver.sh ${WRKSRC}/qserver.sh ${WRKSRC}/stopserver.sh
do-install:
@ ${MKDIR} ${PREFIX}/quakeserver
@@ -43,6 +44,7 @@ do-install:
${INSTALL} -c -o nobody -g nobody -m 0500 ${WRKSRC}/unixded ${PREFIX}/quakeserver
${INSTALL_DATA} ${WRKSRC}/readme.unixded ${PREFIX}/quakeserver
${INSTALL_DATA} ${WRKSRC}/readme.port ${PREFIX}/quakeserver
+ ${INSTALL_SCRIPT} -m 0750 ${WRKSRC}/quakeserver.sh ${PREFIX}/etc/rc.d
${INSTALL} -c -o nobody -g nobody -m 0500 ${WRKSRC}/qserver.sh ${PREFIX}/quakeserver
${INSTALL} -c -o nobody -g nobody -m 0500 ${WRKSRC}/stopserver.sh ${PREFIX}/quakeserver
@ ${RM} -f ${PREFIX}/quakeserver/quakeserver.in
@@ -50,15 +52,6 @@ do-install:
${TOUCH} ${PREFIX}/quakeserver/quakeserver.log
@ ${CHMOD} 700 ${PREFIX}/quakeserver/quakeserver.in ${PREFIX}/quakeserver/quakeserver.log
@ ${CHOWN} -R nobody.nobody ${PREFIX}/quakeserver
- @ ${ECHO} "Installing ${PREFIX}/etc/rc.d/quakeserver.sh startup script"
- @ ${ECHO} "#!/bin/sh" > ${PREFIX}/etc/rc.d/quakeserver.sh
- @ ${ECHO} "#" >> ${PREFIX}/etc/rc.d/quakeserver.sh
- @ ${ECHO} "" >> ${PREFIX}/etc/rc.d/quakeserver.sh
- @ ${ECHO} "if [ -x ${PREFIX}/quakeserver/unixded ]" >> ${PREFIX}/etc/rc.d/quakeserver.sh
- @ ${ECHO} "then" >> ${PREFIX}/etc/rc.d/quakeserver.sh
- @ ${ECHO} " su nobody -c ${PREFIX}/quakeserver/qserver.sh && ${ECHO} -n ' quakeserver'" >> ${PREFIX}/etc/rc.d/quakeserver.sh
- @ ${ECHO} "fi" >> ${PREFIX}/etc/rc.d/quakeserver.sh
- @ ${CHMOD} 750 ${PREFIX}/etc/rc.d/quakeserver.sh
.if !defined(BATCH)
@ /usr/bin/more -e ${PREFIX}/quakeserver/readme.port
.endif
diff --git a/games/quakeserver/files/quakeserver.sh b/games/quakeserver/files/quakeserver.sh
new file mode 100644
index 000000000000..34ce62429115
--- /dev/null
+++ b/games/quakeserver/files/quakeserver.sh
@@ -0,0 +1,21 @@
+#!/bin/sh
+#
+
+case "$1" in
+start)
+ if [ -x %%PREFIX%%/quakeserver/unixded ]
+ then
+ su nobody -c %%PREFIX%%/quakeserver/qserver.sh \
+ && echo -n ' quakeserver'
+ fi
+ ;;
+stop)
+ su nobody -c %%PREFIX%%/quakeserver/qserver.sh && echo -n ' quakeserver'
+ ;;
+*)
+ echo "Usage: `basename $0` {start|stop}" >&2
+ exit 64
+ ;;
+esac
+
+exit 0
diff --git a/games/tetrinet-x/files/tetrinet-x.sh b/games/tetrinet-x/files/tetrinet-x.sh
index 53089b6bc879..74b0aa874847 100644
--- a/games/tetrinet-x/files/tetrinet-x.sh
+++ b/games/tetrinet-x/files/tetrinet-x.sh
@@ -1,4 +1,18 @@
#!/bin/sh
-[ -x /usr/local/tetrinet-x/tetrix.freebsd ] && cd /usr/local/tetrinet-x && \
-tetrix.freebsd > /dev/null && echo -n ' tetrinet-x'
+tetrixdir=/usr/local/tetrinet-x
+tetrix=tetrix.freebsd
+
+case "$1" in
+start)
+ [ -x ${tetrixdir}/${tetrix} ] && cd ${tetrixdir} && \
+ ${tetrixdir}/${tetrix} > /dev/null && echo -n ' tetrinet-x'
+ ;;
+stop)
+ killall ${tetrix} && echo -n ' tetrinet-x'
+ ;;
+*)
+ echo "Usage: `basename $0` {start|stop}" >&2
+ exit 64
+ ;;
+esac
diff --git a/games/uox3/files/uox3.sh b/games/uox3/files/uox3.sh
index 4ff6ae2cea22..77624771473f 100644
--- a/games/uox3/files/uox3.sh
+++ b/games/uox3/files/uox3.sh
@@ -1,5 +1,18 @@
#!/bin/sh
-[ -x /usr/local/uox3/uox3 ] && \
- cd /usr/local/uox3 && \
- /usr/local/uox3/uox3 > /usr/local/uox3/stdout.log & && \
- echo -n ' uox3'
+
+uox3dir=/usr/local/uox3
+
+case "$1" in
+start)
+ [ -x ${uox3dir}/uox3 ] && \
+ cd ${uox3dir} && \
+ uox3 > ${uox3dir}/stdout.log & && \
+ echo -n ' uox3'
+stop)
+ killall uox3 && echo -n ' uox3'
+ ;;
+*)
+ echo "Usage: `basename $0` {start|stop}" >&2
+ exit 64
+ ;;
+esac
diff --git a/irc/irc/Makefile b/irc/irc/Makefile
index f4f663b8f1d5..d202064175fd 100644
--- a/irc/irc/Makefile
+++ b/irc/irc/Makefile
@@ -50,10 +50,7 @@ do-install:
post-install:
@if [ ! -f ${STARTUP_SCRIPT} ]; then \
${ECHO} "Installing ${STARTUP_SCRIPT} startup file."; \
- ${ECHO} '#!/bin/sh' > ${STARTUP_SCRIPT}; \
- ${ECHO} "[ -f ${PREFIX}/etc/ircd/ircd.conf ] && ${PREFIX}/sbin/ircd && ${ECHO} -n ' ircd'" >> ${STARTUP_SCRIPT} ; \
- ${CHMOD} 755 ${STARTUP_SCRIPT} ; \
- ${CHOWN} bin.bin ${STARTUP_SCRIPT}; \
+ ${INSTALL_SCRIPT} ${FILESDIR}/ircd.sh ${STARTUP_SCRIPT};\
fi
.include <bsd.port.post.mk>
diff --git a/irc/irc/files/ircd.sh b/irc/irc/files/ircd.sh
new file mode 100644
index 000000000000..530cc0e52280
--- /dev/null
+++ b/irc/irc/files/ircd.sh
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+case "$1" in
+start)
+ [ -f %%PREFIX%%/etc/ircd/ircd.conf ] && %%PREFIX%%/sbin/ircd && echo -n ' ircd'
+ ;;
+stop)
+ killall ircd && echo -n ' ircd'
+ ;;
+*)
+ echo "Usage: `basename $0` {start|stop}" >&2
+ ;;
+esac
+
+exit 0
diff --git a/irc/ircd-hybrid/files/ircd.sh b/irc/ircd-hybrid/files/ircd.sh
index c594f090e1d3..9fb77f36bb4d 100644
--- a/irc/ircd-hybrid/files/ircd.sh
+++ b/irc/ircd-hybrid/files/ircd.sh
@@ -1,4 +1,17 @@
#!/bin/sh
-[ -x /usr/local/sbin/ircd ] \
-&& /usr/local/sbin/ircd >/dev/null 2>&1 \
-&& echo -n " ircd"
+
+case "$1" in
+start)
+ [ -x /usr/local/sbin/ircd ] \
+ && /usr/local/sbin/ircd >/dev/null 2>&1 \
+ && echo -n " ircd"
+stop)
+ killall ircd && echo -n ' ircd'
+ ;;
+*)
+ echo "Usage: `basename $0` {start|stop}" >&2
+ exit 64
+ ;;
+esac
+
+exit 0
diff --git a/japanese/Canna/files/canna.sh.in b/japanese/Canna/files/canna.sh.in
index beab506bd53a..63eb74665316 100644
--- a/japanese/Canna/files/canna.sh.in
+++ b/japanese/Canna/files/canna.sh.in
@@ -1,10 +1,23 @@
#!/bin/sh
canna=@PREFIX@/sbin/cannaserver
-if [ -f $canna ]; then
- rm -f /var/run/canna/Canna.pid
- mkdir -p /var/run/canna
- touch /var/log/CANNA0msgs
- chown bin:bin /var/run/canna /var/log/CANNA0msgs
- echo -n ' Canna'
- $canna
-fi
+
+case "$1" in
+start)
+ if [ -f $canna ]; then
+ rm -f /var/run/canna/Canna.pid
+ mkdir -p /var/run/canna
+ touch /var/log/CANNA0msgs
+ chown bin:bin /var/run/canna /var/log/CANNA0msgs
+ echo -n ' Canna'
+ $canna
+ fi
+stop)
+ killall $canna && echo -n ' Canna'
+ ;;
+*)
+ echo "Usage: `basename $0` {start|stop}" >&2
+ exit 64
+ ;;
+esac
+
+exit 0
diff --git a/japanese/FreeWnn-server/pkg-install b/japanese/FreeWnn-server/pkg-install
index 9581b53e9ee5..612660afd0e0 100644
--- a/japanese/FreeWnn-server/pkg-install
+++ b/japanese/FreeWnn-server/pkg-install
@@ -145,29 +145,41 @@ POST-INSTALL)
if [ ! -f ${startup_script} ]; then
echo "Installing ${startup_script} startup file.";
echo '#!/bin/sh' > ${startup_script};
- echo "wnn=${wnnserver}" >> ${startup_script};
- echo 'if [ -x $wnn ]; then' >> ${startup_script};
- echo " ${wnnstat} -L ${wnn_lang} localhost > /dev/null 2>&1" >> ${startup_script};
- echo ' if [ $? = 255 ]; then' >> ${startup_script};
- echo " rm -f ${wnn_socket}" >> ${startup_script};
- echo " echo -n ' ${wnnname}'" >> ${startup_script};
- echo ' $wnn' >> ${startup_script};
+ echo 'case $1 in' >> ${startup_script};
+ echo 'start)' >> ${startup_script};
+ echo " wnn=${wnnserver}" >> ${startup_script};
+ echo ' if [ -x $wnn ]; then' >> ${startup_script};
+ echo " ${wnnstat} -L ${wnn_lang} localhost > /dev/null 2>&1" >> ${startup_script};
+ echo ' if [ $? = 255 ]; then' >> ${startup_script};
+ echo " rm -f ${wnn_socket}" >> ${startup_script};
+ echo " echo -n ' ${wnnname}'" >> ${startup_script};
+ echo ' $wnn' >> ${startup_script};
+ echo " fi" >> ${startup_script};
echo " fi" >> ${startup_script};
- echo "fi" >> ${startup_script};
if [ $1 = zh-Wnn-4.2 ]; then
wnnserver=${PKG_PREFIX}/bin/cWnn4/tserver
wnn_lang=zh_TW
wnn_socket=/tmp/td_sockV4
- echo "wnn=${wnnserver}" >> ${startup_script};
- echo 'if [ -x $wnn ]; then' >> ${startup_script};
- echo " ${wnnstat} -L ${wnn_lang} localhost > /dev/null 2>&1" >> ${startup_script};
- echo ' if [ $? = 255 ]; then' >> ${startup_script};
- echo " rm -f ${wnn_socket}" >> ${startup_script};
- echo " echo -n ' ${wnnname}'" >> ${startup_script};
- echo ' $wnn' >> ${startup_script};
+ echo " wnn=${wnnserver}" >> ${startup_script};
+ echo ' if [ -x $wnn ]; then' >> ${startup_script};
+ echo " ${wnnstat} -L ${wnn_lang} localhost > /dev/null 2>&1" >> ${startup_script};
+ echo ' if [ $? = 255 ]; then' >> ${startup_script};
+ echo " rm -f ${wnn_socket}" >> ${startup_script};
+ echo " echo -n ' ${wnnname}'" >> ${startup_script};
+ echo ' $wnn' >> ${startup_script};
+ echo " fi" >> ${startup_script};
echo " fi" >> ${startup_script};
- echo "fi" >> ${startup_script};
fi
+ echo ' ;;' >> ${startup_script};
+ echo 'stop)' >> ${startup_script};
+ echo ' killall $wnn' >> ${startup_script};
+ echo " echo -n ' ${wnnname}'" >> ${startup_script};
+ echo ' ;;' >> ${startup_script};
+ echo '*)' >> ${startup_script};
+ echo ' echo "Usage: `basename $0` {start|stop}" >&2' >> ${startup_script};
+ echo ' ;;' >> ${startup_script};
+ echo 'esac' >> ${startup_script};
+ echo 'exit 0' >> ${startup_script};
chmod 755 ${startup_script};
chown bin.bin ${startup_script};
fi
diff --git a/japanese/Wnn6/pkg-install b/japanese/Wnn6/pkg-install
index e50af7b35e68..915b13031851 100644
--- a/japanese/Wnn6/pkg-install
+++ b/japanese/Wnn6/pkg-install
@@ -173,10 +173,22 @@ POST-INSTALL)
echo "Installing ${startup_script} startup file."
echo '#!/bin/sh' > ${startup_script};
echo "wnn=${wnnserver}" >> ${startup_script};
- echo 'if [ -f $wnn ]; then' >> ${startup_script};
+ echo 'case $1 in' >> ${startup_script};
+ echo 'start)' >> ${startup_script};
+ echo ' if [ -f $wnn ]; then' >> ${startup_script};
+ echo " echo -n ' ${wnnname}'" >> ${startup_script};
+ echo ' $wnn' >> ${startup_script};
+ echo " fi" >> ${startup_script};
+ echo ' ;;' >> ${startup_script};
+ echo 'stop)' >> ${startup_script};
+ echo ' killall $wnn' >> ${startup_script};
echo " echo -n ' ${wnnname}'" >> ${startup_script};
- echo ' $wnn' >> ${startup_script};
- echo "fi" >> ${startup_script};
+ echo ' ;;' >> ${startup_script};
+ echo '*)' >> ${startup_script};
+ echo ' echo "Usage: `basename $0` {start|stop}" >&2' >> ${startup_script};
+ echo ' ;;' >> ${startup_script};
+ echo 'esac' >> ${startup_script};
+ echo 'exit 0' >> ${startup_script};
chmod 755 ${startup_script}
chown bin.bin ${startup_script}
fi
diff --git a/japanese/canna-lib/files/canna.sh.in b/japanese/canna-lib/files/canna.sh.in
index beab506bd53a..63eb74665316 100644
--- a/japanese/canna-lib/files/canna.sh.in
+++ b/japanese/canna-lib/files/canna.sh.in
@@ -1,10 +1,23 @@
#!/bin/sh
canna=@PREFIX@/sbin/cannaserver
-if [ -f $canna ]; then
- rm -f /var/run/canna/Canna.pid
- mkdir -p /var/run/canna
- touch /var/log/CANNA0msgs
- chown bin:bin /var/run/canna /var/log/CANNA0msgs
- echo -n ' Canna'
- $canna
-fi
+
+case "$1" in
+start)
+ if [ -f $canna ]; then
+ rm -f /var/run/canna/Canna.pid
+ mkdir -p /var/run/canna
+ touch /var/log/CANNA0msgs
+ chown bin:bin /var/run/canna /var/log/CANNA0msgs
+ echo -n ' Canna'
+ $canna
+ fi
+stop)
+ killall $canna && echo -n ' Canna'
+ ;;
+*)
+ echo "Usage: `basename $0` {start|stop}" >&2
+ exit 64
+ ;;
+esac
+
+exit 0
diff --git a/japanese/canna-server/files/canna.sh.in b/japanese/canna-server/files/canna.sh.in
index beab506bd53a..63eb74665316 100644
--- a/japanese/canna-server/files/canna.sh.in
+++ b/japanese/canna-server/files/canna.sh.in
@@ -1,10 +1,23 @@
#!/bin/sh
canna=@PREFIX@/sbin/cannaserver
-if [ -f $canna ]; then
- rm -f /var/run/canna/Canna.pid
- mkdir -p /var/run/canna
- touch /var/log/CANNA0msgs
- chown bin:bin /var/run/canna /var/log/CANNA0msgs
- echo -n ' Canna'
- $canna
-fi
+
+case "$1" in
+start)
+ if [ -f $canna ]; then
+ rm -f /var/run/canna/Canna.pid
+ mkdir -p /var/run/canna
+ touch /var/log/CANNA0msgs
+ chown bin:bin /var/run/canna /var/log/CANNA0msgs
+ echo -n ' Canna'
+ $canna
+ fi
+stop)
+ killall $canna && echo -n ' Canna'
+ ;;
+*)
+ echo "Usage: `basename $0` {start|stop}" >&2
+ exit 64
+ ;;
+esac
+
+exit 0
diff --git a/japanese/ebw3/files/ebw3d.sh.sample b/japanese/ebw3/files/ebw3d.sh.sample
index 710f6c6e9e15..d7168858ca91 100644
--- a/japanese/ebw3/files/ebw3d.sh.sample
+++ b/japanese/ebw3/files/ebw3d.sh.sample
@@ -1,6 +1,18 @@
#!/bin/sh
-if [ -f /usr/local/libexec/ebw3d \
- -a -f /usr/local/etc/ebw3d.conf ]; then
- /usr/local/libexec/ebw3d > /var/log/ebw3d.log 2>&1 &
- echo -n ' ebw3d'
-fi
+
+case "$1" in
+start)
+ if [ -f /usr/local/libexec/ebw3d \
+ -a -f /usr/local/etc/ebw3d.conf ]; then
+ /usr/local/libexec/ebw3d > /var/log/ebw3d.log 2>&1 &
+ echo -n ' ebw3d'
+ fi
+ ;;
+stop)
+ killall ebw3d && echo -n ' ebw3d'
+ ;;
+*)
+ echo "Usage: `basename $0` {start|stop}" >&2
+ exit 64
+ ;;
+esac
diff --git a/japanese/elvis/Makefile b/japanese/elvis/Makefile
index cc18cdf7a226..6ebe7ad00db5 100644
--- a/japanese/elvis/Makefile
+++ b/japanese/elvis/Makefile
@@ -34,22 +34,7 @@ post-install:
@${SH} ${PKGDIR}/REQ ${PKGNAME} INSTALL
@if [ ! -f ${STARTUP_SCRIPT} ]; then \
${ECHO} "Installing ${STARTUP_SCRIPT} startup file."; \
- ${ECHO} '#!/bin/sh' > ${STARTUP_SCRIPT}; \
- ${ECHO} 'virecovery=`${ECHO} /var/tmp/elv_*`' \
- >> ${STARTUP_SCRIPT}; \
- ${ECHO} 'if [ "$$virecovery" != '"'/var/tmp/elv_*' ]; then" \
- >> ${STARTUP_SCRIPT}; \
- ${ECHO} " ${ECHO} 'Recovering ja-elvis editor sessions'" \
- >> ${STARTUP_SCRIPT}; \
- ${ECHO} ' for i in $$virecovery; do' \
- >> ${STARTUP_SCRIPT}; \
- ${ECHO} " ${PREFIX}/bin/elvprsv "'$$i' \
- >> ${STARTUP_SCRIPT}; \
- ${ECHO} ' done' \
- >> ${STARTUP_SCRIPT}; \
- ${ECHO} 'fi' >> ${STARTUP_SCRIPT}; \
- ${CHMOD} 755 ${STARTUP_SCRIPT}; \
- ${CHOWN} bin.bin ${STARTUP_SCRIPT}; \
+ ${INSTALL_SCRIPT} ${FILESDIR}/ja-elvis.sh ${STARTUP_SCRIPT};\
fi
.include <bsd.port.mk>
diff --git a/japanese/elvis/files/ja-elvis.sh b/japanese/elvis/files/ja-elvis.sh
new file mode 100644
index 000000000000..10c4b961a0c7
--- /dev/null
+++ b/japanese/elvis/files/ja-elvis.sh
@@ -0,0 +1,25 @@
+#!/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)
+ virecovery=`echo /var/tmp/elv_*`
+ if [ "$virecovery" != '/var/tmp/elv_*' ]; then
+ echo 'Recovering ja-elvis editor sessions'
+ for i in $$virecovery; do
+ ${PREFIX}/bin/elvprsv "$i"
+ done
+ fi
+ ;;
+stop)
+ ;;
+*)
+ echo "Usage: `basename $0` {start|stop}" >&2
+ ;;
+esac
+
+exit 0
diff --git a/japanese/esecanna/files/esecanna.sh b/japanese/esecanna/files/esecanna.sh
index 8a9bf51da9a7..2cbbbef82a07 100644
--- a/japanese/esecanna/files/esecanna.sh
+++ b/japanese/esecanna/files/esecanna.sh
@@ -1,20 +1,40 @@
#!/bin/sh
-if [ -f /usr/local/vje30/.version ] \
- && grep -qw 'FREE TRIAL VERSION' /usr/local/vje30/.version \
- && [ X"$1" != X"-f" ]; then
- echo ""
- echo "esecanna:"
- echo " Using VJE-Delta 3.0 trial, it is unable to connect to vjed on startup."
- echo " Please execute \`$0 -f' manually"
- echo " after once you run vje."
- exit
-fi
-
esecannaserver="!!PREFIX!!/sbin/esecannaserver"
-if [ -x $esecannaserver ]; then
- rm -f /tmp/.iroha_unix/IROHA
- echo -n ' esecannai: '
- $esecannaserver
-fi
+case "$1" in
+restart)
+ if [ -x $esecannaserver ]; then
+ rm -f /tmp/.iroha_unix/IROHA
+ echo -n ' esecannai: '
+ $esecannaserver
+ fi
+ ;;
+start)
+ if [ -f !!PREFIX!!/vje30/.version ] \
+ && grep -qw 'FREE TRIAL VERSION' !!PREFIX!!/vje30/.version \
+ && [ X"$1" != X"restart" ]; then
+ echo ""
+ echo "esecanna:"
+ echo " Using VJE-Delta 3.0 trial, it is unable to connect to vjed on startup."
+ echo " Please execute \`$0 restart' manually"
+ echo " after once you run vje."
+ exit 1
+ fi
+
+ if [ -x $esecannaserver ]; then
+ rm -f /tmp/.iroha_unix/IROHA
+ echo -n ' esecannai: '
+ $esecannaserver
+ fi
+ ;;
+stop)
+ killall $esecannaserver && echo -n ' esecannai'
+ ;;
+*)
+ echo "Usage: `basename $0` {restart|start|stop}" >&2
+ exit 64
+ ;;
+esac
+
+exit 0
diff --git a/japanese/postgresql-tcltk/files/pgsql.sh.tmpl b/japanese/postgresql-tcltk/files/pgsql.sh.tmpl
index 1aef9d941497..d3f0af6cb802 100644
--- a/japanese/postgresql-tcltk/files/pgsql.sh.tmpl
+++ b/japanese/postgresql-tcltk/files/pgsql.sh.tmpl
@@ -16,10 +16,24 @@
# environment variable in !!PG_PATH!!/.profile
#
-[ -d !!PG_PATH!!/lib ] && /sbin/ldconfig -m !!PG_PATH!!/lib
+case "$1" in
+start)
+ [ -d !!PG_PATH!!/lib ] && /sbin/ldconfig -m !!PG_PATH!!/lib
-[ -x !!PG_PATH!!/bin/postmaster ] && {
- su -l !!PGSQL_UID!! -c 'exec !!PG_PATH!!/bin/postmaster -i -S -o -F \
- -D!!PG_PATH!!/data > !!PG_PATH!!/errlog'
- echo -n ' PostgreSQL'
-}
+ [ -x !!PG_PATH!!/bin/postmaster ] && {
+ su -l !!PGSQL_UID!! -c 'exec !!PG_PATH!!/bin/postmaster -i -S -o -F \
+ -D!!PG_PATH!!/data > !!PG_PATH!!/errlog'
+ echo -n ' PostgreSQL'
+ }
+ ;;
+stop)
+ # XXX some pgsql user should check this --tg
+ killall !!PG_PATH!!/bin/postmaster
+ ;;
+*)
+ echo "Usage: `basename $0` {start|stop}" >&2
+ exit 64
+ ;;
+esac
+
+exit 0
diff --git a/japanese/postgresql/files/pgsql.sh.tmpl b/japanese/postgresql/files/pgsql.sh.tmpl
index 1aef9d941497..d3f0af6cb802 100644
--- a/japanese/postgresql/files/pgsql.sh.tmpl
+++ b/japanese/postgresql/files/pgsql.sh.tmpl
@@ -16,10 +16,24 @@
# environment variable in !!PG_PATH!!/.profile
#
-[ -d !!PG_PATH!!/lib ] && /sbin/ldconfig -m !!PG_PATH!!/lib
+case "$1" in
+start)
+ [ -d !!PG_PATH!!/lib ] && /sbin/ldconfig -m !!PG_PATH!!/lib
-[ -x !!PG_PATH!!/bin/postmaster ] && {
- su -l !!PGSQL_UID!! -c 'exec !!PG_PATH!!/bin/postmaster -i -S -o -F \
- -D!!PG_PATH!!/data > !!PG_PATH!!/errlog'
- echo -n ' PostgreSQL'
-}
+ [ -x !!PG_PATH!!/bin/postmaster ] && {
+ su -l !!PGSQL_UID!! -c 'exec !!PG_PATH!!/bin/postmaster -i -S -o -F \
+ -D!!PG_PATH!!/data > !!PG_PATH!!/errlog'
+ echo -n ' PostgreSQL'
+ }
+ ;;
+stop)
+ # XXX some pgsql user should check this --tg
+ killall !!PG_PATH!!/bin/postmaster
+ ;;
+*)
+ echo "Usage: `basename $0` {start|stop}" >&2
+ exit 64
+ ;;
+esac
+
+exit 0
diff --git a/japanese/postgresql7/files/pgsql.sh.tmpl b/japanese/postgresql7/files/pgsql.sh.tmpl
index 1aef9d941497..d3f0af6cb802 100644
--- a/japanese/postgresql7/files/pgsql.sh.tmpl
+++ b/japanese/postgresql7/files/pgsql.sh.tmpl
@@ -16,10 +16,24 @@
# environment variable in !!PG_PATH!!/.profile
#
-[ -d !!PG_PATH!!/lib ] && /sbin/ldconfig -m !!PG_PATH!!/lib
+case "$1" in
+start)
+ [ -d !!PG_PATH!!/lib ] && /sbin/ldconfig -m !!PG_PATH!!/lib
-[ -x !!PG_PATH!!/bin/postmaster ] && {
- su -l !!PGSQL_UID!! -c 'exec !!PG_PATH!!/bin/postmaster -i -S -o -F \
- -D!!PG_PATH!!/data > !!PG_PATH!!/errlog'
- echo -n ' PostgreSQL'
-}
+ [ -x !!PG_PATH!!/bin/postmaster ] && {
+ su -l !!PGSQL_UID!! -c 'exec !!PG_PATH!!/bin/postmaster -i -S -o -F \
+ -D!!PG_PATH!!/data > !!PG_PATH!!/errlog'
+ echo -n ' PostgreSQL'
+ }
+ ;;
+stop)
+ # XXX some pgsql user should check this --tg
+ killall !!PG_PATH!!/bin/postmaster
+ ;;
+*)
+ echo "Usage: `basename $0` {start|stop}" >&2
+ exit 64
+ ;;
+esac
+
+exit 0
diff --git a/japanese/sj3-lib/Makefile b/japanese/sj3-lib/Makefile
index 62b9a2eb114e..d5ecaa18f71b 100644
--- a/japanese/sj3-lib/Makefile
+++ b/japanese/sj3-lib/Makefile
@@ -30,13 +30,7 @@ do-configure:
post-install:
if [ ! -f ${STARTUP_SCRIPT} ]; then \
${ECHO} "Installing ${STARTUP_SCRIPT} startup file."; \
- ${ECHO} '#!/bin/sh' > ${STARTUP_SCRIPT}; \
- ${ECHO} 'sj3=${PREFIX}/bin/sj3serv' >> ${STARTUP_SCRIPT} ; \
- ${ECHO} 'if [ -f $$sj3 ]; then' >> ${STARTUP_SCRIPT} ; \
- ${ECHO} ' $$sj3' >> ${STARTUP_SCRIPT} ; \
- ${ECHO} "fi" >> ${STARTUP_SCRIPT} ; \
- ${CHMOD} 755 ${STARTUP_SCRIPT} ; \
- ${CHOWN} bin.bin ${STARTUP_SCRIPT}; \
+ ${INSTALL_SCRIPT} ${FILESDIR}/sj3.sh ${STARTUP_SCRIPT}; \
fi
${SETENV} PKG_PREFIX=${PREFIX} \
${SH} ${PKGDIR}/INSTALL ${PKGNAME} POST-INSTALL
diff --git a/japanese/sj3-lib/files/sj3.sh.in b/japanese/sj3-lib/files/sj3.sh.in
new file mode 100644
index 000000000000..9361c1d8a604
--- /dev/null
+++ b/japanese/sj3-lib/files/sj3.sh.in
@@ -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
+
+case "$1" in
+start)
+ sj3=${PREFIX}/bin/sj3serv
+ if [ -f $sj3 ]; then
+ $sj3
+ fi
+ ;;
+stop)
+ ;;
+*)
+ echo "Usage: `basename $0` {start|stop}" >&2
+ ;;
+esac
+
+exit 0
diff --git a/japanese/sj3-server/Makefile b/japanese/sj3-server/Makefile
index 62b9a2eb114e..d5ecaa18f71b 100644
--- a/japanese/sj3-server/Makefile
+++ b/japanese/sj3-server/Makefile
@@ -30,13 +30,7 @@ do-configure:
post-install:
if [ ! -f ${STARTUP_SCRIPT} ]; then \
${ECHO} "Installing ${STARTUP_SCRIPT} startup file."; \
- ${ECHO} '#!/bin/sh' > ${STARTUP_SCRIPT}; \
- ${ECHO} 'sj3=${PREFIX}/bin/sj3serv' >> ${STARTUP_SCRIPT} ; \
- ${ECHO} 'if [ -f $$sj3 ]; then' >> ${STARTUP_SCRIPT} ; \
- ${ECHO} ' $$sj3' >> ${STARTUP_SCRIPT} ; \
- ${ECHO} "fi" >> ${STARTUP_SCRIPT} ; \
- ${CHMOD} 755 ${STARTUP_SCRIPT} ; \
- ${CHOWN} bin.bin ${STARTUP_SCRIPT}; \
+ ${INSTALL_SCRIPT} ${FILESDIR}/sj3.sh ${STARTUP_SCRIPT}; \
fi
${SETENV} PKG_PREFIX=${PREFIX} \
${SH} ${PKGDIR}/INSTALL ${PKGNAME} POST-INSTALL
diff --git a/japanese/sj3-server/files/sj3.sh.in b/japanese/sj3-server/files/sj3.sh.in
new file mode 100644
index 000000000000..9361c1d8a604
--- /dev/null
+++ b/japanese/sj3-server/files/sj3.sh.in
@@ -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
+
+case "$1" in
+start)
+ sj3=${PREFIX}/bin/sj3serv
+ if [ -f $sj3 ]; then
+ $sj3
+ fi
+ ;;
+stop)
+ ;;
+*)
+ echo "Usage: `basename $0` {start|stop}" >&2
+ ;;
+esac
+
+exit 0
diff --git a/japanese/sj3/Makefile b/japanese/sj3/Makefile
index 62b9a2eb114e..d5ecaa18f71b 100644
--- a/japanese/sj3/Makefile
+++ b/japanese/sj3/Makefile
@@ -30,13 +30,7 @@ do-configure:
post-install:
if [ ! -f ${STARTUP_SCRIPT} ]; then \
${ECHO} "Installing ${STARTUP_SCRIPT} startup file."; \
- ${ECHO} '#!/bin/sh' > ${STARTUP_SCRIPT}; \
- ${ECHO} 'sj3=${PREFIX}/bin/sj3serv' >> ${STARTUP_SCRIPT} ; \
- ${ECHO} 'if [ -f $$sj3 ]; then' >> ${STARTUP_SCRIPT} ; \
- ${ECHO} ' $$sj3' >> ${STARTUP_SCRIPT} ; \
- ${ECHO} "fi" >> ${STARTUP_SCRIPT} ; \
- ${CHMOD} 755 ${STARTUP_SCRIPT} ; \
- ${CHOWN} bin.bin ${STARTUP_SCRIPT}; \
+ ${INSTALL_SCRIPT} ${FILESDIR}/sj3.sh ${STARTUP_SCRIPT}; \
fi
${SETENV} PKG_PREFIX=${PREFIX} \
${SH} ${PKGDIR}/INSTALL ${PKGNAME} POST-INSTALL
diff --git a/japanese/sj3/files/sj3.sh.in b/japanese/sj3/files/sj3.sh.in
new file mode 100644
index 000000000000..9361c1d8a604
--- /dev/null
+++ b/japanese/sj3/files/sj3.sh.in
@@ -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
+
+case "$1" in
+start)
+ sj3=${PREFIX}/bin/sj3serv
+ if [ -f $sj3 ]; then
+ $sj3
+ fi
+ ;;
+stop)
+ ;;
+*)
+ echo "Usage: `basename $0` {start|stop}" >&2
+ ;;
+esac
+
+exit 0
diff --git a/korean/hanemacs/files/emacs.sh b/korean/hanemacs/files/emacs.sh
index 09baabfd255c..c6976c1b8a18 100644
--- a/korean/hanemacs/files/emacs.sh
+++ b/korean/hanemacs/files/emacs.sh
@@ -1,10 +1,21 @@
#!/bin/sh
-if [ -d /var/run/emacs/lock ]
-then
- rm -f /var/run/emacs/lock/*
-else
- mkdir -p /var/run/emacs/lock
-fi
-chmod 1777 /var/run/emacs/lock
-exit 0
+case "$1" in
+start)
+ if [ -d /var/run/emacs/lock ]
+ then
+ rm -f /var/run/emacs/lock/*
+ else
+ mkdir -p /var/run/emacs/lock
+ fi
+ chmod 1777 /var/run/emacs/lock
+ ;;
+stop)
+ ;;
+*)
+ echo "Usage: `basename $0` {start|stop}" >&2
+ exit 64
+ ;;
+esac
+
+exit 0
diff --git a/lang/modula-3-lib/Makefile b/lang/modula-3-lib/Makefile
index 4d429337b1c8..a055728d6845 100644
--- a/lang/modula-3-lib/Makefile
+++ b/lang/modula-3-lib/Makefile
@@ -153,11 +153,7 @@ do-install:
@if [ ! -f ${startup_script} ]; then \
${ECHO_MSG} "Installing ${startup_script} file"; \
test -d ${startup_dir} || ${MKDIR} ${startup_dir}; \
- ${ECHO} "#!/bin/sh" > ${startup_script}; \
- ${ECHO} "${ECHO} -n ' Modula-3'" >> ${startup_script}; \
- ${ECHO} "${LDCONFIG} -m ${PREFIX}/lib/m3/FreeBSD2" \
- >> ${startup_script}; \
- ${CHMOD} 755 ${startup_script}; \
+ ${INSTALL_SCRIPT} ${FILESDIR}/50.m3.sh ${startup_script}; \
fi
@${ECHO_MSG} "Running ldconfig"
@${SETENV} OBJFORMAT=${PORTOBJFORMAT} ${LDCONFIG} -m ${PREFIX}/lib/m3/FreeBSD2
diff --git a/lang/modula-3-lib/files/50.m3.sh b/lang/modula-3-lib/files/50.m3.sh
new file mode 100644
index 000000000000..fb69bd7e97e4
--- /dev/null
+++ b/lang/modula-3-lib/files/50.m3.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)
+ echo -n ' Modula-3'
+ ldconfig -m ${PREFIX}/lib/m3/FreeBSD2
+ ;;
+stop)
+ ;;
+*)
+ echo "Usage: `basename $0` {start|stop}" >&2
+ ;;
+esac
+
+exit 0
diff --git a/mail/exim-devel/files/exim.sh b/mail/exim-devel/files/exim.sh
index af298538e310..6e25c5a56d0b 100644
--- a/mail/exim-devel/files/exim.sh
+++ b/mail/exim-devel/files/exim.sh
@@ -1,3 +1,17 @@
#!/bin/sh
args='-bd -q30m'
-[ -x /usr/local/sbin/exim ] && /usr/local/sbin/exim $args && echo -n ' exim'
+
+case "$1" in
+start)
+ [ -x /usr/local/sbin/exim ] && /usr/local/sbin/exim $args && echo -n ' exim'
+ ;;
+stop)
+ killall exim && echo -n ' exim'
+ ;;
+*)
+ echo "Usage: `basename $0` {start|stop}" >&2
+ exit 64
+ ;;
+esac
+
+exit 0
diff --git a/mail/exim-old/files/exim.sh b/mail/exim-old/files/exim.sh
index af298538e310..6e25c5a56d0b 100644
--- a/mail/exim-old/files/exim.sh
+++ b/mail/exim-old/files/exim.sh
@@ -1,3 +1,17 @@
#!/bin/sh
args='-bd -q30m'
-[ -x /usr/local/sbin/exim ] && /usr/local/sbin/exim $args && echo -n ' exim'
+
+case "$1" in
+start)
+ [ -x /usr/local/sbin/exim ] && /usr/local/sbin/exim $args && echo -n ' exim'
+ ;;
+stop)
+ killall exim && echo -n ' exim'
+ ;;
+*)
+ echo "Usage: `basename $0` {start|stop}" >&2
+ exit 64
+ ;;
+esac
+
+exit 0
diff --git a/mail/exim/files/exim.sh b/mail/exim/files/exim.sh
index af298538e310..6e25c5a56d0b 100644
--- a/mail/exim/files/exim.sh
+++ b/mail/exim/files/exim.sh
@@ -1,3 +1,17 @@
#!/bin/sh
args='-bd -q30m'
-[ -x /usr/local/sbin/exim ] && /usr/local/sbin/exim $args && echo -n ' exim'
+
+case "$1" in
+start)
+ [ -x /usr/local/sbin/exim ] && /usr/local/sbin/exim $args && echo -n ' exim'
+ ;;
+stop)
+ killall exim && echo -n ' exim'
+ ;;
+*)
+ echo "Usage: `basename $0` {start|stop}" >&2
+ exit 64
+ ;;
+esac
+
+exit 0
diff --git a/mail/youbin/files/youbind.sh.sample b/mail/youbin/files/youbind.sh.sample
index 19f19a39c06d..25f1c277e55e 100644
--- a/mail/youbin/files/youbind.sh.sample
+++ b/mail/youbin/files/youbind.sh.sample
@@ -5,6 +5,19 @@
# If this program is used on your system, great care must be taken
# to avoid any security problem.
#
-if [ -x @PREFIX@/sbin/youbind ]; then
- @PREFIX@/sbin/youbind ; echo -n ' youbind'
-fi
+
+case "$1" in
+start)
+ if [ -x @PREFIX@/sbin/youbind ]; then
+ @PREFIX@/sbin/youbind ; echo -n ' youbind'
+ fi
+stop)
+ killall youbind && echo -n ' youbind'
+ ;;
+*)
+ echo "Usage: `basename $0` {start|stop}" >&2
+ exit 64
+ ;;
+esac
+
+exit 0
diff --git a/mail/zmailer/Makefile b/mail/zmailer/Makefile
index 735e4ac1f67d..31aeca3651ab 100644
--- a/mail/zmailer/Makefile
+++ b/mail/zmailer/Makefile
@@ -63,13 +63,8 @@ post-configure:
${PKGDIR}/MESSAGE > ${PKGMESSAGE}
post-install:
- @${ECHO} #!${SH} > ${PREFIX}/etc/rc.d/zmailer.sh.sample
- @${ECHO} "[ -x ${PREFIX}/sbin/zmailer ] && \
- ${PREFIX}/sbin/zmailer start >/dev/null 2>&1) && \
- ${ECHO} -n \' zmailer\'" \
- >> ${PREFIX}/etc/rc.d/zmailer.sh.sample
- @${CHOWN} root:wheel ${PREFIX}/etc/rc.d/zmailer.sh.sample
- @${CHMOD} a+x ${PREFIX}/etc/rc.d/zmailer.sh.sample
+ @${INSTALL_SCRIPT} ${FILESDIR}/zmailer.sh.sample \
+ ${PREFIX}/etc/rc.d/zmailer.sh.sample
${CAT} ${PKGMESSAGE} | ${SED} -e s:@PREFIX@:${PREFIX}:g \
-e s:@PORTSDIR@:${PORTSDIR}:g
@@ -82,7 +77,7 @@ post-install:
@${ECHO} "# Who do I claim to be?" >> ${PREFIX}/etc/zmailer/mail.conf.sample
@${ECHO} 'mydomain=$$orgdomain' >> ${PREFIX}/etc/zmailer/mail.conf.sample
-# obdained directly from ports/mail/postfix
+# obtained directly from ports/mail/postfix
# with minor hacks by the originator of this port <veers@disturbed.net>
replace:
@${ECHO_MSG} "===> Replacing sendmail"
diff --git a/mail/zmailer/files/zmailer.sh.sample b/mail/zmailer/files/zmailer.sh.sample
new file mode 100644
index 000000000000..63cc33d27277
--- /dev/null
+++ b/mail/zmailer/files/zmailer.sh.sample
@@ -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)
+ [ -x ${PREFIX}/sbin/zmailer ] && \
+ ${PREFIX}/sbin/zmailer start >/dev/null 2>&1 && \
+ echo -n ' zmailer'
+ ;;
+stop)
+ # just a wild guess
+ # ${PREFIX}/sbin/zmailer stop && echo -n ' zmailer'
+ ;;
+*)
+ echo "Usage: `basename $0` {start|stop}" >&2
+ ;;
+esac
+
+exit 0
diff --git a/misc/dnetc/files/dnetc.sh b/misc/dnetc/files/dnetc.sh
index bbbca78e85e4..cccb86d62263 100644
--- a/misc/dnetc/files/dnetc.sh
+++ b/misc/dnetc/files/dnetc.sh
@@ -2,26 +2,39 @@
dir="CHANGETHIS"
-if [ ! -d $dir ]; then
- logger -i "dnetc client directory doesn't exist. ($dir)."
- exit
-fi
+case "$1" in
+start)
+ if [ ! -d $dir ]; then
+ logger -i "dnetc client directory doesn't exist. ($dir)."
+ exit
+ fi
-if [ ! -f $dir/dnetc ]; then
- logger -i "dnetc client doesn't exist. ($dir/dnetc)."
- exit
-fi
+ if [ ! -f $dir/dnetc ]; then
+ logger -i "dnetc client doesn't exist. ($dir/dnetc)."
+ exit
+ fi
-if [ ! -f $dir/dnetc.ini ]; then
- logger -i "dnetc client config file doesn't exist. ($dir/dnetc.ini)."
- exit
-fi
+ if [ ! -f $dir/dnetc.ini ]; then
+ logger -i "dnetc client config file doesn't exist. ($dir/dnetc.ini)."
+ exit
+ fi
-email=`grep "^id=" $dir/dnetc.ini|cut -d"=" -f2`
+ email=`grep "^id=" $dir/dnetc.ini|cut -d"=" -f2`
-if [ "$email" = "rc5@distributed.net" ]; then
- logger -i "dnetc client running with default email address. ($email)"
-fi
+ if [ "$email" = "rc5@distributed.net" ]; then
+ logger -i "dnetc client running with default email address. ($email)"
+ fi
-echo -n " dnetc"
-su -m nobody -c "$dir/dnetc -quiet" 2>/dev/null >/dev/null &
+ echo -n " dnetc"
+ su -m nobody -c "$dir/dnetc -quiet" 2>/dev/null >/dev/null &
+ ;;
+stop)
+ killall dnetc && echo -n " dnetc"
+ ;;
+*)
+ echo "Usage: `basename $0` {start|stop}" >&2
+ exit 64
+ ;;
+esac
+
+exit 0
diff --git a/misc/proxyper/files/proxyper.sh b/misc/proxyper/files/proxyper.sh
index b070a967299f..816115539be3 100644
--- a/misc/proxyper/files/proxyper.sh
+++ b/misc/proxyper/files/proxyper.sh
@@ -2,5 +2,18 @@
dir="CHANGETHIS"
-echo -n " proxyper"
-su -m nobody -c "$dir/proxyper" 2>/dev/null >/dev/null &
+case "$1" in
+start)
+ echo -n " proxyper"
+ su -m nobody -c "$dir/proxyper" 2>/dev/null >/dev/null &
+ ;;
+stop)
+ killall proxyper && echo -n " proxyper"
+ ;;
+*)
+ echo "Usage: `basename $0` {start|stop}" >&2
+ exit 64
+ ;;
+esac
+
+exit 0
diff --git a/net-mgmt/arpwatch-devel/files/arpwatch.sh b/net-mgmt/arpwatch-devel/files/arpwatch.sh
index ebaf7946aac9..f0c8a797cb54 100644
--- a/net-mgmt/arpwatch-devel/files/arpwatch.sh
+++ b/net-mgmt/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-mgmt/arpwatch/files/arpwatch.sh b/net-mgmt/arpwatch/files/arpwatch.sh
index ebaf7946aac9..f0c8a797cb54 100644
--- a/net-mgmt/arpwatch/files/arpwatch.sh
+++ b/net-mgmt/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-mgmt/net-snmp-devel/Makefile b/net-mgmt/net-snmp-devel/Makefile
index f7de629c1338..a6810058b6bc 100644
--- a/net-mgmt/net-snmp-devel/Makefile
+++ b/net-mgmt/net-snmp-devel/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 <bsd.port.post.mk>
diff --git a/net-mgmt/net-snmp-devel/files/snmpd.sh.sample b/net-mgmt/net-snmp-devel/files/snmpd.sh.sample
new file mode 100644
index 000000000000..71f8b504ce81
--- /dev/null
+++ b/net-mgmt/net-snmp-devel/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-mgmt/net-snmp/Makefile b/net-mgmt/net-snmp/Makefile
index f7de629c1338..a6810058b6bc 100644
--- a/net-mgmt/net-snmp/Makefile
+++ b/net-mgmt/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 <bsd.port.post.mk>
diff --git a/net-mgmt/net-snmp/files/snmpd.sh.sample b/net-mgmt/net-snmp/files/snmpd.sh.sample
new file mode 100644
index 000000000000..71f8b504ce81
--- /dev/null
+++ b/net-mgmt/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-mgmt/net-snmp4/Makefile b/net-mgmt/net-snmp4/Makefile
index f7de629c1338..a6810058b6bc 100644
--- a/net-mgmt/net-snmp4/Makefile
+++ b/net-mgmt/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 <bsd.port.post.mk>
diff --git a/net-mgmt/net-snmp4/files/snmpd.sh.sample b/net-mgmt/net-snmp4/files/snmpd.sh.sample
new file mode 100644
index 000000000000..71f8b504ce81
--- /dev/null
+++ b/net-mgmt/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-mgmt/net-snmp53/Makefile b/net-mgmt/net-snmp53/Makefile
index f7de629c1338..a6810058b6bc 100644
--- a/net-mgmt/net-snmp53/Makefile
+++ b/net-mgmt/net-snmp53/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 <bsd.port.post.mk>
diff --git a/net-mgmt/net-snmp53/files/snmpd.sh.sample b/net-mgmt/net-snmp53/files/snmpd.sh.sample
new file mode 100644
index 000000000000..71f8b504ce81
--- /dev/null
+++ b/net-mgmt/net-snmp53/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-mgmt/wide-dhcp/Makefile b/net-mgmt/wide-dhcp/Makefile
index 6eb19087709d..1078aaaf5ac4 100644
--- a/net-mgmt/wide-dhcp/Makefile
+++ b/net-mgmt/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-mgmt/wide-dhcp/files/wide-dhcps.sh.sample b/net-mgmt/wide-dhcp/files/wide-dhcps.sh.sample
new file mode 100644
index 000000000000..6cab4e824a0f
--- /dev/null
+++ b/net-mgmt/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/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 <bsd.port.post.mk>
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 <bsd.port.post.mk>
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 <bsd.port.post.mk>
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 <bsd.port.post.mk>
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 <bsd.port.post.mk>
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 <bsd.port.post.mk>
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
diff --git a/news/diablo/scripts/diablo.sh b/news/diablo/scripts/diablo.sh
index 38f4d8bc14f3..4d00b4dd3571 100644
--- a/news/diablo/scripts/diablo.sh
+++ b/news/diablo/scripts/diablo.sh
@@ -1,5 +1,17 @@
#!/bin/sh
-if [ -x %%PREFIX%%/news/rc.news ] ; then
- %%PREFIX%%/news/rc.news && echo -n ' diablo'
-fi
+case $1 in
+start)
+ if [ -x %%PREFIX%%/news/rc.news ] ; then
+ %%PREFIX%%/news/rc.news && echo -n ' diablo'
+ fi
+ ;;
+stop)
+ ;;
+*)
+ echo "Usage: `basename $0` {start|stop}" >&2
+ exit 64
+ ;;
+esac
+
+exit 0
diff --git a/news/diablo/scripts/diablo.sh-sample b/news/diablo/scripts/diablo.sh-sample
index 38f4d8bc14f3..4d00b4dd3571 100644
--- a/news/diablo/scripts/diablo.sh-sample
+++ b/news/diablo/scripts/diablo.sh-sample
@@ -1,5 +1,17 @@
#!/bin/sh
-if [ -x %%PREFIX%%/news/rc.news ] ; then
- %%PREFIX%%/news/rc.news && echo -n ' diablo'
-fi
+case $1 in
+start)
+ if [ -x %%PREFIX%%/news/rc.news ] ; then
+ %%PREFIX%%/news/rc.news && echo -n ' diablo'
+ fi
+ ;;
+stop)
+ ;;
+*)
+ echo "Usage: `basename $0` {start|stop}" >&2
+ exit 64
+ ;;
+esac
+
+exit 0
diff --git a/news/dnews/files/dnews.sh b/news/dnews/files/dnews.sh
index b714714205ea..0a478e70a1f0 100644
--- a/news/dnews/files/dnews.sh
+++ b/news/dnews/files/dnews.sh
@@ -2,11 +2,23 @@
# start dnews if it's really there ... usually in /usr/local ...
-[ -x /usr/local/lib/dnews/dnews_start ] \
- && /usr/local/lib/dnews/dnews_start > /dev/null 2>&1 &
+case $1 in
+start)
+ [ -x /usr/local/lib/dnews/dnews_start ] \
+ && /usr/local/lib/dnews/dnews_start > /dev/null 2>&1 &
-# dnews started successfully if exit status = 0
+ # dnews started successfully if exit status = 0
-if [ $? -eq 0 ]; then
- echo -n ' dnews'
-fi
+ if [ $? -eq 0 ]; then
+ echo -n ' dnews'
+ fi
+ ;;
+stop)
+ ;;
+*)
+ echo "Usage: `basename $0` {start|stop}" >&2
+ exit 64
+ ;;
+esac
+
+exit 0
diff --git a/russian/apache13/Makefile b/russian/apache13/Makefile
index 3461407f7d59..fa9ff28073c8 100644
--- a/russian/apache13/Makefile
+++ b/russian/apache13/Makefile
@@ -81,9 +81,7 @@ pre-install:
post-install:
@if [ ! -f ${PREFIX}/etc/rc.d/apache.sh ]; then \
${ECHO} "Installing ${PREFIX}/etc/rc.d/apache.sh startup file."; \
- ${ECHO} "#!/bin/sh" > ${PREFIX}/etc/rc.d/apache.sh; \
- ${ECHO} "[ -x ${PREFIX}/sbin/apachectl ] && ${PREFIX}/sbin/apachectl start > /dev/null && ${ECHO_MSG} -n ' apache'" >> ${PREFIX}/etc/rc.d/apache.sh; \
- ${CHMOD} 751 ${PREFIX}/etc/rc.d/apache.sh; \
+ ${INSTALL_SCRIPT} -m 751 ${FILESDIR}/apache.sh ${PREFIX}/etc/rc.d/apache.sh; \
fi
.include <bsd.port.mk>
diff --git a/russian/apache13/files/apache.sh b/russian/apache13/files/apache.sh
new file mode 100644
index 000000000000..619918254852
--- /dev/null
+++ b/russian/apache13/files/apache.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/apachectl ] && ${PREFIX}/sbin/apachectl start > /dev/null && echo -n ' apache'
+ ;;
+stop)
+ [ -r /var/run/httpd.pid ] && ${PREFIX}/apachectl stop > /dev/null && echo -n ' apache'
+ ;;
+*)
+ echo "Usage: `basename $0` {start|stop}" >&2
+ ;;
+esac
+
+exit 0
diff --git a/security/xinetd/Makefile b/security/xinetd/Makefile
index 2c5de6234fdd..2de8506ddb30 100644
--- a/security/xinetd/Makefile
+++ b/security/xinetd/Makefile
@@ -24,11 +24,7 @@ MAN8= xinetd.8 xinetd.log.8
post-install:
@if [ ! -f ${PREFIX}/etc/rc.d/xinetd.sh ]; then \
${ECHO} "Install ${PREFIX}/etc/rc.d/xinetd.sh startup file."; \
- ${ECHO} "#!/bin/sh" > ${PREFIX}/etc/rc.d/xinetd.sh; \
- ${ECHO} "[ -x ${PREFIX}/sbin/xinetd ] &&" >> ${PREFIX}/etc/rc.d/xinetd.sh; \
- ${ECHO} "${PREFIX}/sbin/xinetd -pid 2> /var/run/xinetd.pid &&" >> ${PREFIX}/etc/rc.d/xinetd.sh; \
- ${ECHO} "${ECHO} -n ' xinetd'" >> ${PREFIX}/etc/rc.d/xinetd.sh; \
- ${CHMOD} 751 ${PREFIX}/etc/rc.d/xinetd.sh; \
+ ${INSTALL_SCRIPT} -m 751 ${FILESDIR}/xinetd.sh ${PREFIX}/etc/rc.d/xinetd.sh; \
fi
strip ${PREFIX}/sbin/xinetd
diff --git a/security/xinetd/files/xinetd.sh b/security/xinetd/files/xinetd.sh
new file mode 100644
index 000000000000..37a550d6f3ee
--- /dev/null
+++ b/security/xinetd/files/xinetd.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
+
+case "$1" in
+start)
+ [ -x ${PREFIX}/sbin/xinetd ] && \
+ ${PREFIX}/sbin/xinetd -pid 2> /var/run/xinetd.pid && \
+ echo -n ' xinetd'
+ ;;
+stop)
+ killall xinetd && echo -n ' xinetd'
+ ;;
+*)
+ echo "Usage: `basename $0` {start|stop}" >&2
+ ;;
+esac
+
+exit 0
diff --git a/sysutils/healthd/Makefile b/sysutils/healthd/Makefile
index f31214f3e1be..1a3d8c8c6110 100644
--- a/sysutils/healthd/Makefile
+++ b/sysutils/healthd/Makefile
@@ -20,9 +20,7 @@ MAN8= healthd.8 healthdc.8
post-install:
@if [ ! -f ${PREFIX}/etc/rc.d/healthd.sh ]; then \
${ECHO} "Installing ${PREFIX}/etc/rc.d/healthd.sh startup file."; \
- ${ECHO} "#!/bin/sh" > ${PREFIX}/etc/rc.d/healthd.sh; \
- ${ECHO} "[ -x ${PREFIX}/bin/healthd ] && ${PREFIX}/bin/healthd > /dev/null && ${ECHO} -n ' healthd'" >> ${PREFIX}/etc/rc.d/healthd.sh; \
- ${CHMOD} 751 ${PREFIX}/etc/rc.d/healthd.sh; \
+ ${INSTALL_SCRIPT} -m 751 ${FILESDIR}/healthd.sh ${PREFIX}/etc/rc.d/healthd.sh; \
fi
@if [ ! -f ${PREFIX}/etc/healthd.conf ]; then \
${ECHO} "Installing ${PREFIX}/etc/healthd.conf configuration file."; \
diff --git a/sysutils/syslog-ng/Makefile b/sysutils/syslog-ng/Makefile
index 9fc3d8bb0fac..f4d9b66e80d3 100644
--- a/sysutils/syslog-ng/Makefile
+++ b/sysutils/syslog-ng/Makefile
@@ -51,9 +51,7 @@ post-install:
fi
@if [ ! -f ${PREFIX}/etc/rc.d/syslog-ng.sh.sample ]; then \
${ECHO} "Installing ${PREFIX}/etc/rc.d/syslog-ng.sh.sample startup file."; \
- ${ECHO} "#!/bin/sh" > ${PREFIX}/etc/rc.d/syslog-ng.sh.sample; \
- ${ECHO} "[ -x ${PREFIX}/sbin/syslog-ng ] && ${PREFIX}/sbin/syslog-ng && ${ECHO} -n ' syslog-ng'" >> ${PREFIX}/etc/rc.d/syslog-ng.sh.sample; \
- ${CHMOD} 755 ${PREFIX}/etc/rc.d/syslog-ng.sh.sample; \
+ ${INSTALL_SCRIPT} ${FILESDIR}/syslog-ng.sh.sample ${PREFIX}/etc/rc.d/syslog-ng.sh.sample; \
fi
@${CAT} ${PKGMESSAGE}
diff --git a/sysutils/syslog-ng/files/syslog-ng.sh.sample b/sysutils/syslog-ng/files/syslog-ng.sh.sample
new file mode 100644
index 000000000000..9aff5b0d38eb
--- /dev/null
+++ b/sysutils/syslog-ng/files/syslog-ng.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/syslog-ng ] && ${PREFIX}/sbin/syslog-ng && echo -n ' syslog-ng'
+ ;;
+stop)
+ killall syslog-ng && echo -n ' syslog-ng'
+ ;;
+*)
+ echo "Usage: `basename $0` {start|stop}" >&2
+ ;;
+esac
+
+exit 0
diff --git a/sysutils/syslog-ng1/Makefile b/sysutils/syslog-ng1/Makefile
index 9fc3d8bb0fac..f4d9b66e80d3 100644
--- a/sysutils/syslog-ng1/Makefile
+++ b/sysutils/syslog-ng1/Makefile
@@ -51,9 +51,7 @@ post-install:
fi
@if [ ! -f ${PREFIX}/etc/rc.d/syslog-ng.sh.sample ]; then \
${ECHO} "Installing ${PREFIX}/etc/rc.d/syslog-ng.sh.sample startup file."; \
- ${ECHO} "#!/bin/sh" > ${PREFIX}/etc/rc.d/syslog-ng.sh.sample; \
- ${ECHO} "[ -x ${PREFIX}/sbin/syslog-ng ] && ${PREFIX}/sbin/syslog-ng && ${ECHO} -n ' syslog-ng'" >> ${PREFIX}/etc/rc.d/syslog-ng.sh.sample; \
- ${CHMOD} 755 ${PREFIX}/etc/rc.d/syslog-ng.sh.sample; \
+ ${INSTALL_SCRIPT} ${FILESDIR}/syslog-ng.sh.sample ${PREFIX}/etc/rc.d/syslog-ng.sh.sample; \
fi
@${CAT} ${PKGMESSAGE}
diff --git a/sysutils/syslog-ng1/files/syslog-ng.sh.sample b/sysutils/syslog-ng1/files/syslog-ng.sh.sample
new file mode 100644
index 000000000000..9aff5b0d38eb
--- /dev/null
+++ b/sysutils/syslog-ng1/files/syslog-ng.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/syslog-ng ] && ${PREFIX}/sbin/syslog-ng && echo -n ' syslog-ng'
+ ;;
+stop)
+ killall syslog-ng && echo -n ' syslog-ng'
+ ;;
+*)
+ echo "Usage: `basename $0` {start|stop}" >&2
+ ;;
+esac
+
+exit 0
diff --git a/sysutils/upsmon/files/upsmon.sh b/sysutils/upsmon/files/upsmon.sh
index 3b1c302c4cb7..11a3971819f3 100644
--- a/sysutils/upsmon/files/upsmon.sh
+++ b/sysutils/upsmon/files/upsmon.sh
@@ -1,7 +1,20 @@
#!/bin/sh
-# see !!PREFIX!!/share/doc/upsmon/INSTALL for command line option details
+case $1 in
+start)
+ # see !!PREFIX!!/share/doc/upsmon/INSTALL for command line option details
-if [ -x !!PREFIX!!/sbin/upsmond ]; then
- !!PREFIX!!/sbin/upsmond -p /dev/cuaa0 2>&1 > /dev/null && echo -n ' upsmond'
-fi
+ if [ -x !!PREFIX!!/sbin/upsmond ]; then
+ !!PREFIX!!/sbin/upsmond -p /dev/cuaa0 2>&1 > /dev/null && echo -n ' upsmond'
+ fi
+ ;;
+stop)
+ killall updmond && echo -n ' upsmond'
+ ;;
+*)
+ echo "Usage: `basename $0` {start|stop}" >&2
+ exit 64
+ ;;
+esac
+
+exit 0
diff --git a/textproc/coco/Makefile b/textproc/coco/Makefile
index c8f15a0f428b..96f31f66cd13 100644
--- a/textproc/coco/Makefile
+++ b/textproc/coco/Makefile
@@ -152,16 +152,7 @@ post-install:
@${TOUCH} ${TOUCH_FLAGS} ${INSTALL_COOKIE}
if [ ! -f ${STARTUP_SCRIPT} ]; then \
${ECHO} "Installing ${STARTUP_SCRIPT} startup file."; \
- ${ECHO} '#!/bin/sh' > ${STARTUP_SCRIPT}; \
- ${ECHO} '#${ECHO} -n " Mule"' >> ${STARTUP_SCRIPT}; \
- ${ECHO} 'if [ -d /var/run/emacs/lock ]; then' >> ${STARTUP_SCRIPT}; \
- ${ECHO} ' rm -f /var/run/emacs/lock/*' >> ${STARTUP_SCRIPT}; \
- ${ECHO} "else" >> ${STARTUP_SCRIPT}; \
- ${ECHO} " mkdir -p /var/run/emacs/lock" >> ${STARTUP_SCRIPT}; \
- ${ECHO} "fi" >> ${STARTUP_SCRIPT} ; \
- ${ECHO} "${CHMOD} 1777 /var/run/emacs/lock${lockdir}" >> ${STARTUP_SCRIPT} ; \
- ${CHMOD} 755 ${STARTUP_SCRIPT} ; \
- ${CHOWN} bin.bin ${STARTUP_SCRIPT}; \
+ ${INSTALL_SCRIPT} ${FILESDIR}/mule.sh ${STARTUPSCRIPT}; \
fi
post-package:
diff --git a/textproc/coco/files/mule.sh b/textproc/coco/files/mule.sh
new file mode 100644
index 000000000000..c6976c1b8a18
--- /dev/null
+++ b/textproc/coco/files/mule.sh
@@ -0,0 +1,21 @@
+#!/bin/sh
+
+case "$1" in
+start)
+ if [ -d /var/run/emacs/lock ]
+ then
+ rm -f /var/run/emacs/lock/*
+ else
+ mkdir -p /var/run/emacs/lock
+ fi
+ chmod 1777 /var/run/emacs/lock
+ ;;
+stop)
+ ;;
+*)
+ echo "Usage: `basename $0` {start|stop}" >&2
+ exit 64
+ ;;
+esac
+
+exit 0
diff --git a/www/adzapper/files/rc.adzapper.sh b/www/adzapper/files/rc.adzapper.sh
index dae560de5241..b7949ad8646a 100644
--- a/www/adzapper/files/rc.adzapper.sh
+++ b/www/adzapper/files/rc.adzapper.sh
@@ -1,6 +1,19 @@
#!/bin/sh
-if [ -f __PRERFIX__/etc/adzapper.conf ]; then
- __PREFIX__/sbin/adzapper &
- test $? -eq 0 && echo -n ' adzapper'
-fi
+case $1 in
+start)
+ if [ -f __PREFIX__/etc/adzapper.conf ]; then
+ __PREFIX__/sbin/adzapper &
+ test $? -eq 0 && echo -n ' adzapper'
+ fi
+ ;;
+stop)
+ killall adzapper && echo -n ' adzapper'
+ ;;
+*)
+ echo "Usage: `basename $0` {start|stop}" >&2
+ exit 64
+ ;;
+esac
+
+exit 0
diff --git a/www/apache13+ipv6/Makefile b/www/apache13+ipv6/Makefile
index c1b0bec56d33..ed43b35cdc18 100644
--- a/www/apache13+ipv6/Makefile
+++ b/www/apache13+ipv6/Makefile
@@ -79,8 +79,6 @@ pre-configure:
post-install:
@if [ ! -f ${PREFIX}/etc/rc.d/apache.sh ]; then \
${ECHO} "Installing ${PREFIX}/etc/rc.d/apache.sh startup file."; \
- ${ECHO} "#!/bin/sh" > ${PREFIX}/etc/rc.d/apache.sh; \
- ${ECHO} "[ -x ${PREFIX}/sbin/apachectl ] && ${PREFIX}/sbin/apachectl start > /dev/null && ${ECHO} -n ' apache'" >> ${PREFIX}/etc/rc.d/apache.sh; \
- ${CHMOD} 751 ${PREFIX}/etc/rc.d/apache.sh; \
+ ${INSTALL_SCRIPT} -m 751 ${FILESDIR}/apache.sh ${PREFIX}/etc/rc.d/apache.sh; \
fi
.include <bsd.port.post.mk>
diff --git a/www/apache13+ipv6/files/apache.sh b/www/apache13+ipv6/files/apache.sh
new file mode 100644
index 000000000000..619918254852
--- /dev/null
+++ b/www/apache13+ipv6/files/apache.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/apachectl ] && ${PREFIX}/sbin/apachectl start > /dev/null && echo -n ' apache'
+ ;;
+stop)
+ [ -r /var/run/httpd.pid ] && ${PREFIX}/apachectl stop > /dev/null && echo -n ' apache'
+ ;;
+*)
+ echo "Usage: `basename $0` {start|stop}" >&2
+ ;;
+esac
+
+exit 0
diff --git a/www/apache13-modssl/files/apache.sh b/www/apache13-modssl/files/apache.sh
new file mode 100644
index 000000000000..619918254852
--- /dev/null
+++ b/www/apache13-modssl/files/apache.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/apachectl ] && ${PREFIX}/sbin/apachectl start > /dev/null && echo -n ' apache'
+ ;;
+stop)
+ [ -r /var/run/httpd.pid ] && ${PREFIX}/apachectl stop > /dev/null && echo -n ' apache'
+ ;;
+*)
+ echo "Usage: `basename $0` {start|stop}" >&2
+ ;;
+esac
+
+exit 0
diff --git a/www/apache13/Makefile b/www/apache13/Makefile
index dd375e352db8..62259aaf3c63 100644
--- a/www/apache13/Makefile
+++ b/www/apache13/Makefile
@@ -63,9 +63,7 @@ MAN8= ab.8 apachectl.8 apxs.8 httpd.8 logresolve.8 rotatelogs.8
post-install:
@if [ ! -f ${PREFIX}/etc/rc.d/apache.sh ]; then \
${ECHO} "Installing ${PREFIX}/etc/rc.d/apache.sh startup file."; \
- ${ECHO} "#!/bin/sh" > ${PREFIX}/etc/rc.d/apache.sh; \
- ${ECHO} "[ -x ${PREFIX}/sbin/apachectl ] && ${PREFIX}/sbin/apachectl start > /dev/null && ${ECHO} -n ' apache'" >> ${PREFIX}/etc/rc.d/apache.sh; \
- ${CHMOD} 751 ${PREFIX}/etc/rc.d/apache.sh; \
+ ${INSTALL_SCRIPT} -m 751 ${FILESDIR}/apache.sh ${PREFIX}/etc/rc.d/apache.sh; \
fi
.include <bsd.port.mk>
diff --git a/www/apache13/files/apache.sh b/www/apache13/files/apache.sh
new file mode 100644
index 000000000000..619918254852
--- /dev/null
+++ b/www/apache13/files/apache.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/apachectl ] && ${PREFIX}/sbin/apachectl start > /dev/null && echo -n ' apache'
+ ;;
+stop)
+ [ -r /var/run/httpd.pid ] && ${PREFIX}/apachectl stop > /dev/null && echo -n ' apache'
+ ;;
+*)
+ echo "Usage: `basename $0` {start|stop}" >&2
+ ;;
+esac
+
+exit 0
diff --git a/www/apache2/Makefile b/www/apache2/Makefile
index dd375e352db8..62259aaf3c63 100644
--- a/www/apache2/Makefile
+++ b/www/apache2/Makefile
@@ -63,9 +63,7 @@ MAN8= ab.8 apachectl.8 apxs.8 httpd.8 logresolve.8 rotatelogs.8
post-install:
@if [ ! -f ${PREFIX}/etc/rc.d/apache.sh ]; then \
${ECHO} "Installing ${PREFIX}/etc/rc.d/apache.sh startup file."; \
- ${ECHO} "#!/bin/sh" > ${PREFIX}/etc/rc.d/apache.sh; \
- ${ECHO} "[ -x ${PREFIX}/sbin/apachectl ] && ${PREFIX}/sbin/apachectl start > /dev/null && ${ECHO} -n ' apache'" >> ${PREFIX}/etc/rc.d/apache.sh; \
- ${CHMOD} 751 ${PREFIX}/etc/rc.d/apache.sh; \
+ ${INSTALL_SCRIPT} -m 751 ${FILESDIR}/apache.sh ${PREFIX}/etc/rc.d/apache.sh; \
fi
.include <bsd.port.mk>
diff --git a/www/apache2/files/apache.sh b/www/apache2/files/apache.sh
new file mode 100644
index 000000000000..619918254852
--- /dev/null
+++ b/www/apache2/files/apache.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/apachectl ] && ${PREFIX}/sbin/apachectl start > /dev/null && echo -n ' apache'
+ ;;
+stop)
+ [ -r /var/run/httpd.pid ] && ${PREFIX}/apachectl stop > /dev/null && echo -n ' apache'
+ ;;
+*)
+ echo "Usage: `basename $0` {start|stop}" >&2
+ ;;
+esac
+
+exit 0
diff --git a/www/apache20/Makefile b/www/apache20/Makefile
index dd375e352db8..62259aaf3c63 100644
--- a/www/apache20/Makefile
+++ b/www/apache20/Makefile
@@ -63,9 +63,7 @@ MAN8= ab.8 apachectl.8 apxs.8 httpd.8 logresolve.8 rotatelogs.8
post-install:
@if [ ! -f ${PREFIX}/etc/rc.d/apache.sh ]; then \
${ECHO} "Installing ${PREFIX}/etc/rc.d/apache.sh startup file."; \
- ${ECHO} "#!/bin/sh" > ${PREFIX}/etc/rc.d/apache.sh; \
- ${ECHO} "[ -x ${PREFIX}/sbin/apachectl ] && ${PREFIX}/sbin/apachectl start > /dev/null && ${ECHO} -n ' apache'" >> ${PREFIX}/etc/rc.d/apache.sh; \
- ${CHMOD} 751 ${PREFIX}/etc/rc.d/apache.sh; \
+ ${INSTALL_SCRIPT} -m 751 ${FILESDIR}/apache.sh ${PREFIX}/etc/rc.d/apache.sh; \
fi
.include <bsd.port.mk>
diff --git a/www/apache20/files/apache.sh b/www/apache20/files/apache.sh
new file mode 100644
index 000000000000..619918254852
--- /dev/null
+++ b/www/apache20/files/apache.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/apachectl ] && ${PREFIX}/sbin/apachectl start > /dev/null && echo -n ' apache'
+ ;;
+stop)
+ [ -r /var/run/httpd.pid ] && ${PREFIX}/apachectl stop > /dev/null && echo -n ' apache'
+ ;;
+*)
+ echo "Usage: `basename $0` {start|stop}" >&2
+ ;;
+esac
+
+exit 0
diff --git a/www/apache21/Makefile b/www/apache21/Makefile
index dd375e352db8..62259aaf3c63 100644
--- a/www/apache21/Makefile
+++ b/www/apache21/Makefile
@@ -63,9 +63,7 @@ MAN8= ab.8 apachectl.8 apxs.8 httpd.8 logresolve.8 rotatelogs.8
post-install:
@if [ ! -f ${PREFIX}/etc/rc.d/apache.sh ]; then \
${ECHO} "Installing ${PREFIX}/etc/rc.d/apache.sh startup file."; \
- ${ECHO} "#!/bin/sh" > ${PREFIX}/etc/rc.d/apache.sh; \
- ${ECHO} "[ -x ${PREFIX}/sbin/apachectl ] && ${PREFIX}/sbin/apachectl start > /dev/null && ${ECHO} -n ' apache'" >> ${PREFIX}/etc/rc.d/apache.sh; \
- ${CHMOD} 751 ${PREFIX}/etc/rc.d/apache.sh; \
+ ${INSTALL_SCRIPT} -m 751 ${FILESDIR}/apache.sh ${PREFIX}/etc/rc.d/apache.sh; \
fi
.include <bsd.port.mk>
diff --git a/www/apache21/files/apache.sh b/www/apache21/files/apache.sh
new file mode 100644
index 000000000000..619918254852
--- /dev/null
+++ b/www/apache21/files/apache.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/apachectl ] && ${PREFIX}/sbin/apachectl start > /dev/null && echo -n ' apache'
+ ;;
+stop)
+ [ -r /var/run/httpd.pid ] && ${PREFIX}/apachectl stop > /dev/null && echo -n ' apache'
+ ;;
+*)
+ echo "Usage: `basename $0` {start|stop}" >&2
+ ;;
+esac
+
+exit 0
diff --git a/www/apache22/Makefile b/www/apache22/Makefile
index dd375e352db8..62259aaf3c63 100644
--- a/www/apache22/Makefile
+++ b/www/apache22/Makefile
@@ -63,9 +63,7 @@ MAN8= ab.8 apachectl.8 apxs.8 httpd.8 logresolve.8 rotatelogs.8
post-install:
@if [ ! -f ${PREFIX}/etc/rc.d/apache.sh ]; then \
${ECHO} "Installing ${PREFIX}/etc/rc.d/apache.sh startup file."; \
- ${ECHO} "#!/bin/sh" > ${PREFIX}/etc/rc.d/apache.sh; \
- ${ECHO} "[ -x ${PREFIX}/sbin/apachectl ] && ${PREFIX}/sbin/apachectl start > /dev/null && ${ECHO} -n ' apache'" >> ${PREFIX}/etc/rc.d/apache.sh; \
- ${CHMOD} 751 ${PREFIX}/etc/rc.d/apache.sh; \
+ ${INSTALL_SCRIPT} -m 751 ${FILESDIR}/apache.sh ${PREFIX}/etc/rc.d/apache.sh; \
fi
.include <bsd.port.mk>
diff --git a/www/apache22/files/apache.sh b/www/apache22/files/apache.sh
new file mode 100644
index 000000000000..619918254852
--- /dev/null
+++ b/www/apache22/files/apache.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/apachectl ] && ${PREFIX}/sbin/apachectl start > /dev/null && echo -n ' apache'
+ ;;
+stop)
+ [ -r /var/run/httpd.pid ] && ${PREFIX}/apachectl stop > /dev/null && echo -n ' apache'
+ ;;
+*)
+ echo "Usage: `basename $0` {start|stop}" >&2
+ ;;
+esac
+
+exit 0
diff --git a/www/httptunnel/files/httptunnel.sh b/www/httptunnel/files/httptunnel.sh
index 153c3faa8754..c919064ea036 100644
--- a/www/httptunnel/files/httptunnel.sh
+++ b/www/httptunnel/files/httptunnel.sh
@@ -16,21 +16,35 @@ HTCPROXYBUFFER=1K # Buffer size for buffered proxies
HTCBROWSER='Mozilla/4.7 [en] (X11; I; Linux 2.2.12 i386)' # Pretend to be this
HTCARGS=-S # Any other arguments required
-if [ -n "$HTSPORT" -a -x /usr/local/bin/hts ]; then
- [ -n "$HTSFORWARD" ] && args="-F $HTSFORWARD"
- [ -n "$HTSDEVICE" ] && args="-d $HTSDEVICE"
- /usr/local/bin/hts $args $HTSPORT && echo -n ' hts'
-fi
+case $1 in
+start)
+ if [ -n "$HTSPORT" -a -x $HTS ]; then
+ [ -n "$HTSFORWARD" ] && args="-F $HTSFORWARD"
+ [ -n "$HTSDEVICE" ] && args="-d $HTSDEVICE"
+ /usr/local/bin/hts $args $HTSPORT && echo -n ' hts'
+ fi
-if [ -n "$HTCPORT" -a -x /usr/local/bin/htc ]; then
- set --
- [ -n "$HTCFORWARD" ] && set -- -F $HTCFORWARD
- [ -n "$HTCDEVICE" ] && set -- -d $HTCDEVICE
- [ -n "$HTCBROWSER" ] && set -- -U "$HTCBROWSER" "$@"
- if [ -n "$HTCPROXY" ]; then
- [ -n "$HTCPROXYBUFFER" ] && set -- -B $HTCPROXYBUFFER "$@"
- [ -n "$HTCPROXYAUTH" ] && set -- -A $HTCPROXYAUTH "$@"
- set -- -P $HTCPROXY "$@"
+ if [ -n "$HTCPORT" -a -x $HTC ]; then
+ set --
+ [ -n "$HTCFORWARD" ] && set -- -F $HTCFORWARD
+ [ -n "$HTCDEVICE" ] && set -- -d $HTCDEVICE
+ [ -n "$HTCBROWSER" ] && set -- -U "$HTCBROWSER" "$@"
+ if [ -n "$HTCPROXY" ]; then
+ [ -n "$HTCPROXYBUFFER" ] && set -- -B $HTCPROXYBUFFER "$@"
+ [ -n "$HTCPROXYAUTH" ] && set -- -A $HTCPROXYAUTH "$@"
+ set -- -P $HTCPROXY "$@"
+ fi
+ /usr/local/bin/htc "$@" $HTCARGS $HTCPORT && echo -n ' htc'
fi
- /usr/local/bin/htc "$@" $HTCARGS $HTCPORT && echo -n ' htc'
-fi
+ ;;
+stop)
+ killall htc && echo -n ' htc'
+ killall hts && echo -n ' hts'
+ ;;
+*)
+ echo "Usage: `basename $0` {start|stop}" >&2
+ exit 64
+ ;;
+esac
+
+exit 0
diff --git a/www/junkbuster-zlib/files/junkbuster.sh.in b/www/junkbuster-zlib/files/junkbuster.sh.in
index d0b89028f6ad..9f3e639a9494 100644
--- a/www/junkbuster-zlib/files/junkbuster.sh.in
+++ b/www/junkbuster-zlib/files/junkbuster.sh.in
@@ -1,5 +1,19 @@
#!/bin/sh
-test -d JDIR -a -x PREFIX/sbin/junkbuster -a -f JDIR/configfile || exit 1
-cd JDIR
-su -m nobody -c "PREFIX/sbin/junkbuster configfile &"
-echo -n " junkbuster"
+
+case $1 in
+start)
+ test -d JDIR -a -x PREFIX/sbin/junkbuster -a -f JDIR/configfile || exit 1
+ cd JDIR
+ su -m nobody -c "PREFIX/sbin/junkbuster configfile &"
+ echo -n " junkbuster"
+ ;;
+stop)
+ killall junkbuster && echo -n " junkbuster"
+ ;;
+*)
+ echo "Usage: `basename $0` {start|stop}" >&2
+ exit 64
+ ;;
+esac
+
+exit 0
diff --git a/www/junkbuster/files/junkbuster.sh.in b/www/junkbuster/files/junkbuster.sh.in
index d0b89028f6ad..9f3e639a9494 100644
--- a/www/junkbuster/files/junkbuster.sh.in
+++ b/www/junkbuster/files/junkbuster.sh.in
@@ -1,5 +1,19 @@
#!/bin/sh
-test -d JDIR -a -x PREFIX/sbin/junkbuster -a -f JDIR/configfile || exit 1
-cd JDIR
-su -m nobody -c "PREFIX/sbin/junkbuster configfile &"
-echo -n " junkbuster"
+
+case $1 in
+start)
+ test -d JDIR -a -x PREFIX/sbin/junkbuster -a -f JDIR/configfile || exit 1
+ cd JDIR
+ su -m nobody -c "PREFIX/sbin/junkbuster configfile &"
+ echo -n " junkbuster"
+ ;;
+stop)
+ killall junkbuster && echo -n " junkbuster"
+ ;;
+*)
+ echo "Usage: `basename $0` {start|stop}" >&2
+ exit 64
+ ;;
+esac
+
+exit 0
diff --git a/www/mathopd/Makefile b/www/mathopd/Makefile
index 64e527abd0ed..146952e45843 100644
--- a/www/mathopd/Makefile
+++ b/www/mathopd/Makefile
@@ -23,9 +23,7 @@ post-install:
@${INSTALL_DATA} ${WRKSRC}/README ${PREFIX}/share/doc/mathopd
.endif
@if [ ! -f ${PREFIX}/etc/rc.d/mathopd.sh ]; then \
- ${ECHO} "#! ${SH}" > ${PREFIX}/etc/rc.d/mathopd.sh; \
- ${ECHO} "[ -x ${PREFIX}/sbin/mathopd ] && ${PREFIX}/sbin/mathopd < ${PREFIX}/etc/mathopd.conf && ${ECHO} -n ' mathopd'" >> ${PREFIX}/etc/rc.d/mathopd.sh; \
- ${CHMOD} 440 ${PREFIX}/etc/rc.d/mathopd.sh; \
+ ${INSTALL_SCRIPT} ${FILESDIR}/mathopd.sh ${PREFIX}/etc/rc.d/mathopd.sh; \
fi
@${SED} -e 's,/usr/local,${PREFIX},g' ${PKGMESSAGE}
diff --git a/www/mathopd/files/mathopd.sh b/www/mathopd/files/mathopd.sh
new file mode 100644
index 000000000000..eea3bacb5712
--- /dev/null
+++ b/www/mathopd/files/mathopd.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/mathopd ] && ${PREFIX}/sbin/mathopd < ${PREFIX}/etc/mathopd.conf && echo -n ' mathopd'
+ ;;
+stop)
+ killall mathopd && echo -n ' mathopd'
+ ;;
+*)
+ echo "Usage: `basename $0` {start|stop}" >&2
+ ;;
+esac
+
+exit 0
diff --git a/www/roxen/files/roxen.sh.in b/www/roxen/files/roxen.sh.in
index 2ad784a42659..0ea626d2c349 100644
--- a/www/roxen/files/roxen.sh.in
+++ b/www/roxen/files/roxen.sh.in
@@ -1,7 +1,19 @@
#!/bin/sh
roxen=%%PREFIX%%/roxen/server
-if [ -x $roxen/start ]; then
- ( cd $roxen; ./start --log-dir=/var/log/roxen ) > /dev/null
- echo -n ' Roxen'
-fi
+case $1 in
+start)
+ if [ -x $roxen/start ]; then
+ ( cd $roxen; ./start --log-dir=/var/log/roxen ) > /dev/null
+ echo -n ' Roxen'
+ fi
+ ;;
+stop)
+ ;;
+*)
+ echo "Usage: `basename $0` {start|stop}" >&2
+ exit 64
+ ;;
+esac
+
+exit 0
diff --git a/www/squid/Makefile b/www/squid/Makefile
index 7595a8afd6f6..92a95b12339c 100644
--- a/www/squid/Makefile
+++ b/www/squid/Makefile
@@ -108,11 +108,7 @@ post-install:
${MKDIR} ${PREFIX}/squid/cache
@if [ ! -f ${PREFIX}/etc/rc.d/squid.sh ]; then \
${ECHO} "Installing ${PREFIX}/etc/rc.d/squid.sh startup file."; \
- ${ECHO} "#!/bin/sh" > ${PREFIX}/etc/rc.d/squid.sh; \
- ${ECHO} "if [ -x ${PREFIX}/sbin/RunCache -a -f ${PREFIX}/etc/squid/squid.conf ]; then" >> ${PREFIX}/etc/rc.d/squid.sh; \
- ${ECHO} " (cd /tmp; ${PREFIX}/sbin/RunCache >/dev/null 2>&1 &) ; ${ECHO} -n ' squid'" >> ${PREFIX}/etc/rc.d/squid.sh; \
- ${ECHO} "fi" >> ${PREFIX}/etc/rc.d/squid.sh; \
- ${CHMOD} 751 ${PREFIX}/etc/rc.d/squid.sh; \
+ ${INSTALL_SCRIPT} -m 751 ${FILESDIR}/squid.sh ${PREFIX}/etc/rc.d/squid.sh; \
fi
.include <bsd.port.mk>
diff --git a/www/squid/files/squid.sh b/www/squid/files/squid.sh
new file mode 100644
index 000000000000..e9a3144e8c93
--- /dev/null
+++ b/www/squid/files/squid.sh
@@ -0,0 +1,21 @@
+#!/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)
+ if [ -x ${PREFIX}/sbin/RunCache -a -f ${PREFIX}/etc/squid/squid.conf ]; then
+ (cd /tmp; ${PREFIX}/sbin/RunCache >/dev/null 2>&1 &) ; echo -n ' squid'
+ fi
+ ;;
+stop)
+ ;;
+*)
+ echo "Usage: `basename $0` {start|stop}" >&2
+ ;;
+esac
+
+exit 0
diff --git a/www/squid22/Makefile b/www/squid22/Makefile
index a1befca5c73d..84b00c8a5f8d 100644
--- a/www/squid22/Makefile
+++ b/www/squid22/Makefile
@@ -95,11 +95,7 @@ post-install:
${MKDIR} ${PREFIX}/squid/cache
@if [ ! -f ${PREFIX}/etc/rc.d/squid.sh ]; then \
${ECHO} "Installing ${PREFIX}/etc/rc.d/squid.sh startup file."; \
- ${ECHO} "#!/bin/sh" > ${PREFIX}/etc/rc.d/squid.sh; \
- ${ECHO} "if [ -x ${PREFIX}/sbin/RunCache -a -f ${PREFIX}/etc/squid/squid.conf ]; then" >> ${PREFIX}/etc/rc.d/squid.sh; \
- ${ECHO} " (cd /tmp; ${PREFIX}/sbin/RunCache >/dev/null 2>&1 &) ; ${ECHO} -n ' squid'" >> ${PREFIX}/etc/rc.d/squid.sh; \
- ${ECHO} "fi" >> ${PREFIX}/etc/rc.d/squid.sh; \
- ${CHMOD} 751 ${PREFIX}/etc/rc.d/squid.sh; \
+ ${INSTALL_SCRIPT} -m 751 ${FILESDIR}/squid.sh ${PREFIX}/etc/rc.d/squid.sh; \
fi
.include <bsd.port.mk>
diff --git a/www/squid22/files/squid.sh b/www/squid22/files/squid.sh
new file mode 100644
index 000000000000..e9a3144e8c93
--- /dev/null
+++ b/www/squid22/files/squid.sh
@@ -0,0 +1,21 @@
+#!/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)
+ if [ -x ${PREFIX}/sbin/RunCache -a -f ${PREFIX}/etc/squid/squid.conf ]; then
+ (cd /tmp; ${PREFIX}/sbin/RunCache >/dev/null 2>&1 &) ; echo -n ' squid'
+ fi
+ ;;
+stop)
+ ;;
+*)
+ echo "Usage: `basename $0` {start|stop}" >&2
+ ;;
+esac
+
+exit 0
diff --git a/www/squid23/Makefile b/www/squid23/Makefile
index 7595a8afd6f6..92a95b12339c 100644
--- a/www/squid23/Makefile
+++ b/www/squid23/Makefile
@@ -108,11 +108,7 @@ post-install:
${MKDIR} ${PREFIX}/squid/cache
@if [ ! -f ${PREFIX}/etc/rc.d/squid.sh ]; then \
${ECHO} "Installing ${PREFIX}/etc/rc.d/squid.sh startup file."; \
- ${ECHO} "#!/bin/sh" > ${PREFIX}/etc/rc.d/squid.sh; \
- ${ECHO} "if [ -x ${PREFIX}/sbin/RunCache -a -f ${PREFIX}/etc/squid/squid.conf ]; then" >> ${PREFIX}/etc/rc.d/squid.sh; \
- ${ECHO} " (cd /tmp; ${PREFIX}/sbin/RunCache >/dev/null 2>&1 &) ; ${ECHO} -n ' squid'" >> ${PREFIX}/etc/rc.d/squid.sh; \
- ${ECHO} "fi" >> ${PREFIX}/etc/rc.d/squid.sh; \
- ${CHMOD} 751 ${PREFIX}/etc/rc.d/squid.sh; \
+ ${INSTALL_SCRIPT} -m 751 ${FILESDIR}/squid.sh ${PREFIX}/etc/rc.d/squid.sh; \
fi
.include <bsd.port.mk>
diff --git a/www/squid23/files/squid.sh b/www/squid23/files/squid.sh
new file mode 100644
index 000000000000..e9a3144e8c93
--- /dev/null
+++ b/www/squid23/files/squid.sh
@@ -0,0 +1,21 @@
+#!/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)
+ if [ -x ${PREFIX}/sbin/RunCache -a -f ${PREFIX}/etc/squid/squid.conf ]; then
+ (cd /tmp; ${PREFIX}/sbin/RunCache >/dev/null 2>&1 &) ; echo -n ' squid'
+ fi
+ ;;
+stop)
+ ;;
+*)
+ echo "Usage: `basename $0` {start|stop}" >&2
+ ;;
+esac
+
+exit 0
diff --git a/www/squid24/Makefile b/www/squid24/Makefile
index 7595a8afd6f6..92a95b12339c 100644
--- a/www/squid24/Makefile
+++ b/www/squid24/Makefile
@@ -108,11 +108,7 @@ post-install:
${MKDIR} ${PREFIX}/squid/cache
@if [ ! -f ${PREFIX}/etc/rc.d/squid.sh ]; then \
${ECHO} "Installing ${PREFIX}/etc/rc.d/squid.sh startup file."; \
- ${ECHO} "#!/bin/sh" > ${PREFIX}/etc/rc.d/squid.sh; \
- ${ECHO} "if [ -x ${PREFIX}/sbin/RunCache -a -f ${PREFIX}/etc/squid/squid.conf ]; then" >> ${PREFIX}/etc/rc.d/squid.sh; \
- ${ECHO} " (cd /tmp; ${PREFIX}/sbin/RunCache >/dev/null 2>&1 &) ; ${ECHO} -n ' squid'" >> ${PREFIX}/etc/rc.d/squid.sh; \
- ${ECHO} "fi" >> ${PREFIX}/etc/rc.d/squid.sh; \
- ${CHMOD} 751 ${PREFIX}/etc/rc.d/squid.sh; \
+ ${INSTALL_SCRIPT} -m 751 ${FILESDIR}/squid.sh ${PREFIX}/etc/rc.d/squid.sh; \
fi
.include <bsd.port.mk>
diff --git a/www/squid24/files/squid.sh b/www/squid24/files/squid.sh
new file mode 100644
index 000000000000..e9a3144e8c93
--- /dev/null
+++ b/www/squid24/files/squid.sh
@@ -0,0 +1,21 @@
+#!/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)
+ if [ -x ${PREFIX}/sbin/RunCache -a -f ${PREFIX}/etc/squid/squid.conf ]; then
+ (cd /tmp; ${PREFIX}/sbin/RunCache >/dev/null 2>&1 &) ; echo -n ' squid'
+ fi
+ ;;
+stop)
+ ;;
+*)
+ echo "Usage: `basename $0` {start|stop}" >&2
+ ;;
+esac
+
+exit 0
diff --git a/www/squid25/Makefile b/www/squid25/Makefile
index 7595a8afd6f6..92a95b12339c 100644
--- a/www/squid25/Makefile
+++ b/www/squid25/Makefile
@@ -108,11 +108,7 @@ post-install:
${MKDIR} ${PREFIX}/squid/cache
@if [ ! -f ${PREFIX}/etc/rc.d/squid.sh ]; then \
${ECHO} "Installing ${PREFIX}/etc/rc.d/squid.sh startup file."; \
- ${ECHO} "#!/bin/sh" > ${PREFIX}/etc/rc.d/squid.sh; \
- ${ECHO} "if [ -x ${PREFIX}/sbin/RunCache -a -f ${PREFIX}/etc/squid/squid.conf ]; then" >> ${PREFIX}/etc/rc.d/squid.sh; \
- ${ECHO} " (cd /tmp; ${PREFIX}/sbin/RunCache >/dev/null 2>&1 &) ; ${ECHO} -n ' squid'" >> ${PREFIX}/etc/rc.d/squid.sh; \
- ${ECHO} "fi" >> ${PREFIX}/etc/rc.d/squid.sh; \
- ${CHMOD} 751 ${PREFIX}/etc/rc.d/squid.sh; \
+ ${INSTALL_SCRIPT} -m 751 ${FILESDIR}/squid.sh ${PREFIX}/etc/rc.d/squid.sh; \
fi
.include <bsd.port.mk>
diff --git a/www/squid25/files/squid.sh b/www/squid25/files/squid.sh
new file mode 100644
index 000000000000..e9a3144e8c93
--- /dev/null
+++ b/www/squid25/files/squid.sh
@@ -0,0 +1,21 @@
+#!/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)
+ if [ -x ${PREFIX}/sbin/RunCache -a -f ${PREFIX}/etc/squid/squid.conf ]; then
+ (cd /tmp; ${PREFIX}/sbin/RunCache >/dev/null 2>&1 &) ; echo -n ' squid'
+ fi
+ ;;
+stop)
+ ;;
+*)
+ echo "Usage: `basename $0` {start|stop}" >&2
+ ;;
+esac
+
+exit 0
diff --git a/www/squid26/Makefile b/www/squid26/Makefile
index 7595a8afd6f6..92a95b12339c 100644
--- a/www/squid26/Makefile
+++ b/www/squid26/Makefile
@@ -108,11 +108,7 @@ post-install:
${MKDIR} ${PREFIX}/squid/cache
@if [ ! -f ${PREFIX}/etc/rc.d/squid.sh ]; then \
${ECHO} "Installing ${PREFIX}/etc/rc.d/squid.sh startup file."; \
- ${ECHO} "#!/bin/sh" > ${PREFIX}/etc/rc.d/squid.sh; \
- ${ECHO} "if [ -x ${PREFIX}/sbin/RunCache -a -f ${PREFIX}/etc/squid/squid.conf ]; then" >> ${PREFIX}/etc/rc.d/squid.sh; \
- ${ECHO} " (cd /tmp; ${PREFIX}/sbin/RunCache >/dev/null 2>&1 &) ; ${ECHO} -n ' squid'" >> ${PREFIX}/etc/rc.d/squid.sh; \
- ${ECHO} "fi" >> ${PREFIX}/etc/rc.d/squid.sh; \
- ${CHMOD} 751 ${PREFIX}/etc/rc.d/squid.sh; \
+ ${INSTALL_SCRIPT} -m 751 ${FILESDIR}/squid.sh ${PREFIX}/etc/rc.d/squid.sh; \
fi
.include <bsd.port.mk>
diff --git a/www/squid26/files/squid.sh b/www/squid26/files/squid.sh
new file mode 100644
index 000000000000..e9a3144e8c93
--- /dev/null
+++ b/www/squid26/files/squid.sh
@@ -0,0 +1,21 @@
+#!/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)
+ if [ -x ${PREFIX}/sbin/RunCache -a -f ${PREFIX}/etc/squid/squid.conf ]; then
+ (cd /tmp; ${PREFIX}/sbin/RunCache >/dev/null 2>&1 &) ; echo -n ' squid'
+ fi
+ ;;
+stop)
+ ;;
+*)
+ echo "Usage: `basename $0` {start|stop}" >&2
+ ;;
+esac
+
+exit 0
diff --git a/www/squid27/Makefile b/www/squid27/Makefile
index 7595a8afd6f6..92a95b12339c 100644
--- a/www/squid27/Makefile
+++ b/www/squid27/Makefile
@@ -108,11 +108,7 @@ post-install:
${MKDIR} ${PREFIX}/squid/cache
@if [ ! -f ${PREFIX}/etc/rc.d/squid.sh ]; then \
${ECHO} "Installing ${PREFIX}/etc/rc.d/squid.sh startup file."; \
- ${ECHO} "#!/bin/sh" > ${PREFIX}/etc/rc.d/squid.sh; \
- ${ECHO} "if [ -x ${PREFIX}/sbin/RunCache -a -f ${PREFIX}/etc/squid/squid.conf ]; then" >> ${PREFIX}/etc/rc.d/squid.sh; \
- ${ECHO} " (cd /tmp; ${PREFIX}/sbin/RunCache >/dev/null 2>&1 &) ; ${ECHO} -n ' squid'" >> ${PREFIX}/etc/rc.d/squid.sh; \
- ${ECHO} "fi" >> ${PREFIX}/etc/rc.d/squid.sh; \
- ${CHMOD} 751 ${PREFIX}/etc/rc.d/squid.sh; \
+ ${INSTALL_SCRIPT} -m 751 ${FILESDIR}/squid.sh ${PREFIX}/etc/rc.d/squid.sh; \
fi
.include <bsd.port.mk>
diff --git a/www/squid27/files/squid.sh b/www/squid27/files/squid.sh
new file mode 100644
index 000000000000..e9a3144e8c93
--- /dev/null
+++ b/www/squid27/files/squid.sh
@@ -0,0 +1,21 @@
+#!/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)
+ if [ -x ${PREFIX}/sbin/RunCache -a -f ${PREFIX}/etc/squid/squid.conf ]; then
+ (cd /tmp; ${PREFIX}/sbin/RunCache >/dev/null 2>&1 &) ; echo -n ' squid'
+ fi
+ ;;
+stop)
+ ;;
+*)
+ echo "Usage: `basename $0` {start|stop}" >&2
+ ;;
+esac
+
+exit 0
diff --git a/www/squid30/Makefile b/www/squid30/Makefile
index 7595a8afd6f6..92a95b12339c 100644
--- a/www/squid30/Makefile
+++ b/www/squid30/Makefile
@@ -108,11 +108,7 @@ post-install:
${MKDIR} ${PREFIX}/squid/cache
@if [ ! -f ${PREFIX}/etc/rc.d/squid.sh ]; then \
${ECHO} "Installing ${PREFIX}/etc/rc.d/squid.sh startup file."; \
- ${ECHO} "#!/bin/sh" > ${PREFIX}/etc/rc.d/squid.sh; \
- ${ECHO} "if [ -x ${PREFIX}/sbin/RunCache -a -f ${PREFIX}/etc/squid/squid.conf ]; then" >> ${PREFIX}/etc/rc.d/squid.sh; \
- ${ECHO} " (cd /tmp; ${PREFIX}/sbin/RunCache >/dev/null 2>&1 &) ; ${ECHO} -n ' squid'" >> ${PREFIX}/etc/rc.d/squid.sh; \
- ${ECHO} "fi" >> ${PREFIX}/etc/rc.d/squid.sh; \
- ${CHMOD} 751 ${PREFIX}/etc/rc.d/squid.sh; \
+ ${INSTALL_SCRIPT} -m 751 ${FILESDIR}/squid.sh ${PREFIX}/etc/rc.d/squid.sh; \
fi
.include <bsd.port.mk>
diff --git a/www/squid30/files/squid.sh b/www/squid30/files/squid.sh
new file mode 100644
index 000000000000..e9a3144e8c93
--- /dev/null
+++ b/www/squid30/files/squid.sh
@@ -0,0 +1,21 @@
+#!/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)
+ if [ -x ${PREFIX}/sbin/RunCache -a -f ${PREFIX}/etc/squid/squid.conf ]; then
+ (cd /tmp; ${PREFIX}/sbin/RunCache >/dev/null 2>&1 &) ; echo -n ' squid'
+ fi
+ ;;
+stop)
+ ;;
+*)
+ echo "Usage: `basename $0` {start|stop}" >&2
+ ;;
+esac
+
+exit 0
diff --git a/www/squid31/Makefile b/www/squid31/Makefile
index 7595a8afd6f6..92a95b12339c 100644
--- a/www/squid31/Makefile
+++ b/www/squid31/Makefile
@@ -108,11 +108,7 @@ post-install:
${MKDIR} ${PREFIX}/squid/cache
@if [ ! -f ${PREFIX}/etc/rc.d/squid.sh ]; then \
${ECHO} "Installing ${PREFIX}/etc/rc.d/squid.sh startup file."; \
- ${ECHO} "#!/bin/sh" > ${PREFIX}/etc/rc.d/squid.sh; \
- ${ECHO} "if [ -x ${PREFIX}/sbin/RunCache -a -f ${PREFIX}/etc/squid/squid.conf ]; then" >> ${PREFIX}/etc/rc.d/squid.sh; \
- ${ECHO} " (cd /tmp; ${PREFIX}/sbin/RunCache >/dev/null 2>&1 &) ; ${ECHO} -n ' squid'" >> ${PREFIX}/etc/rc.d/squid.sh; \
- ${ECHO} "fi" >> ${PREFIX}/etc/rc.d/squid.sh; \
- ${CHMOD} 751 ${PREFIX}/etc/rc.d/squid.sh; \
+ ${INSTALL_SCRIPT} -m 751 ${FILESDIR}/squid.sh ${PREFIX}/etc/rc.d/squid.sh; \
fi
.include <bsd.port.mk>
diff --git a/www/squid31/files/squid.sh b/www/squid31/files/squid.sh
new file mode 100644
index 000000000000..e9a3144e8c93
--- /dev/null
+++ b/www/squid31/files/squid.sh
@@ -0,0 +1,21 @@
+#!/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)
+ if [ -x ${PREFIX}/sbin/RunCache -a -f ${PREFIX}/etc/squid/squid.conf ]; then
+ (cd /tmp; ${PREFIX}/sbin/RunCache >/dev/null 2>&1 &) ; echo -n ' squid'
+ fi
+ ;;
+stop)
+ ;;
+*)
+ echo "Usage: `basename $0` {start|stop}" >&2
+ ;;
+esac
+
+exit 0
diff --git a/www/thttpd/Makefile b/www/thttpd/Makefile
index ff4fb236a0ba..6b57a4e4b8ac 100644
--- a/www/thttpd/Makefile
+++ b/www/thttpd/Makefile
@@ -53,9 +53,7 @@ do-install:
@${ECHO} "pidfile=/var/run/thttpd.pid" >> ${PREFIX}/etc/thttpd.conf.sample
@if [ ! -f ${PREFIX}/etc/rc.d/thttpd.sh ]; then \
${ECHO} "Installing ${PREFIX}/etc/rc.d/thttpd.sh startup file."; \
- ${ECHO} "#!/bin/sh" > ${PREFIX}/etc/rc.d/thttpd.sh; \
- ${ECHO} "[ -x ${PREFIX}/sbin/thttpd_wrapper ] && ${PREFIX}/sbin/thttpd_wrapper && ${ECHO} -n ' thttpd'" >> ${PREFIX}/etc/rc.d/thttpd.sh; \
- ${CHMOD} 751 ${PREFIX}/etc/rc.d/thttpd.sh; \
+ ${INSTALL_SCRIPT} -m 751 ${FILESDIR}/thttpd.sh ${PREFIX}/etc/rc.d/thttpd.sh; \
fi
.if !defined(NOPORTDOCS)
@${MKDIR} ${PREFIX}/share/doc/thttpd
diff --git a/www/thttpd/files/thttpd.sh b/www/thttpd/files/thttpd.sh
new file mode 100644
index 000000000000..34a848a96082
--- /dev/null
+++ b/www/thttpd/files/thttpd.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/thttpd_wrapper ] && ${PREFIX}/sbin/thttpd_wrapper && echo -n ' thttpd'
+ ;;
+stop)
+ killall thttpd_wrapper && killall thttpd && echo -n ' thttpd'
+ ;;
+*)
+ echo "Usage: `basename $0` {start|stop}" >&2
+ ;;
+esac
+
+exit 0
diff --git a/www/wwwoffle/files/wwwoffled.sh b/www/wwwoffle/files/wwwoffled.sh
index a902bb203d68..3764e197d88b 100644
--- a/www/wwwoffle/files/wwwoffled.sh
+++ b/www/wwwoffle/files/wwwoffled.sh
@@ -1,2 +1,17 @@
#!/bin/sh
-[ -x %PREFIX%/sbin/wwwoffled ] && %PREFIX%/sbin/wwwoffled > /dev/null && echo -n ' wwwoffled'
+
+case $1 in
+start)
+ [ -x %PREFIX%/sbin/wwwoffled ] && \
+ %PREFIX%/sbin/wwwoffled > /dev/null && echo -n ' wwwoffled'
+ ;;
+stop)
+ killall wwwoffled && echo -n ' wwwoffled'
+ ;;
+*)
+ echo "Usage: `basename $0` {start|stop}" >&2
+ exit 64
+ ;;
+esac
+
+exit 0
diff --git a/www/zope/Makefile b/www/zope/Makefile
index 11ec49d80dca..21e3eb68c7c6 100644
--- a/www/zope/Makefile
+++ b/www/zope/Makefile
@@ -65,9 +65,8 @@ do-install: #
${ECHO} "===> Please have a look at this file and the instructions" ; \
${ECHO} "===> therein and incorporate them to your apache.conf." ; \
${ECHO} "===> Creating rc startup file for Zope-${PORTVERSION}..." ; \
- ${ECHO} "#! /bin/sh" > ${PREFIX}/etc/rc.d/zope.sh ; \
- ${ECHO} "${ZOPEBASEDIR}/start -w '' -f '' -m '' -p ${CGI_BIN_DIR}/Zope.cgi &" >> ${PREFIX}/etc/rc.d/zope.sh ; \
- ${ECHO} "echo -n \" Zope\"" >> ${PREFIX}/etc/rc.d/zope.sh ; \
+ ${SED} -e "s|%%ZOPEBASEDIR%%|${ZOPEBASEDIR}|g" -e "s|%%CGI_BIN_DIR%%|${CGI_BIN_DIR}|g" \
+ < ${FILESDIR}/zope.sh.in > ${PREFIX}/etc.rc.d/zope.sh; \
${CHMOD} ug+x,o-rwx ${PREFIX}/etc/rc.d/zope.sh ; \
${ECHO} "===> Done with ${PREFIX}/etc/rc.d/zope.sh." ; \
${CAT} ${FILESDIR}/Message ; \
diff --git a/www/zope/files/zope.sh.in b/www/zope/files/zope.sh.in
new file mode 100644
index 000000000000..156a319c8125
--- /dev/null
+++ b/www/zope/files/zope.sh.in
@@ -0,0 +1,17 @@
+#!/bin/sh
+
+case "$1" in
+start)
+ %%ZOPEBASEDIR%%/start -w '' -f '' -m '' -p %%CGI_BIN_DIR%%/Zope.cgi &
+ echo -n " Zope"
+ ;;
+stop)
+ %%ZOPEBASEDIR%% stop
+ echo -n " Zope"
+ ;;
+*)
+ echo "Usage: `basename $0` {start|stop}" >&2
+ ;;
+esac
+
+exit 0
diff --git a/www/zope210/Makefile b/www/zope210/Makefile
index 11ec49d80dca..21e3eb68c7c6 100644
--- a/www/zope210/Makefile
+++ b/www/zope210/Makefile
@@ -65,9 +65,8 @@ do-install: #
${ECHO} "===> Please have a look at this file and the instructions" ; \
${ECHO} "===> therein and incorporate them to your apache.conf." ; \
${ECHO} "===> Creating rc startup file for Zope-${PORTVERSION}..." ; \
- ${ECHO} "#! /bin/sh" > ${PREFIX}/etc/rc.d/zope.sh ; \
- ${ECHO} "${ZOPEBASEDIR}/start -w '' -f '' -m '' -p ${CGI_BIN_DIR}/Zope.cgi &" >> ${PREFIX}/etc/rc.d/zope.sh ; \
- ${ECHO} "echo -n \" Zope\"" >> ${PREFIX}/etc/rc.d/zope.sh ; \
+ ${SED} -e "s|%%ZOPEBASEDIR%%|${ZOPEBASEDIR}|g" -e "s|%%CGI_BIN_DIR%%|${CGI_BIN_DIR}|g" \
+ < ${FILESDIR}/zope.sh.in > ${PREFIX}/etc.rc.d/zope.sh; \
${CHMOD} ug+x,o-rwx ${PREFIX}/etc/rc.d/zope.sh ; \
${ECHO} "===> Done with ${PREFIX}/etc/rc.d/zope.sh." ; \
${CAT} ${FILESDIR}/Message ; \
diff --git a/www/zope210/files/zope.sh.in b/www/zope210/files/zope.sh.in
new file mode 100644
index 000000000000..156a319c8125
--- /dev/null
+++ b/www/zope210/files/zope.sh.in
@@ -0,0 +1,17 @@
+#!/bin/sh
+
+case "$1" in
+start)
+ %%ZOPEBASEDIR%%/start -w '' -f '' -m '' -p %%CGI_BIN_DIR%%/Zope.cgi &
+ echo -n " Zope"
+ ;;
+stop)
+ %%ZOPEBASEDIR%% stop
+ echo -n " Zope"
+ ;;
+*)
+ echo "Usage: `basename $0` {start|stop}" >&2
+ ;;
+esac
+
+exit 0
diff --git a/www/zope211/Makefile b/www/zope211/Makefile
index 11ec49d80dca..21e3eb68c7c6 100644
--- a/www/zope211/Makefile
+++ b/www/zope211/Makefile
@@ -65,9 +65,8 @@ do-install: #
${ECHO} "===> Please have a look at this file and the instructions" ; \
${ECHO} "===> therein and incorporate them to your apache.conf." ; \
${ECHO} "===> Creating rc startup file for Zope-${PORTVERSION}..." ; \
- ${ECHO} "#! /bin/sh" > ${PREFIX}/etc/rc.d/zope.sh ; \
- ${ECHO} "${ZOPEBASEDIR}/start -w '' -f '' -m '' -p ${CGI_BIN_DIR}/Zope.cgi &" >> ${PREFIX}/etc/rc.d/zope.sh ; \
- ${ECHO} "echo -n \" Zope\"" >> ${PREFIX}/etc/rc.d/zope.sh ; \
+ ${SED} -e "s|%%ZOPEBASEDIR%%|${ZOPEBASEDIR}|g" -e "s|%%CGI_BIN_DIR%%|${CGI_BIN_DIR}|g" \
+ < ${FILESDIR}/zope.sh.in > ${PREFIX}/etc.rc.d/zope.sh; \
${CHMOD} ug+x,o-rwx ${PREFIX}/etc/rc.d/zope.sh ; \
${ECHO} "===> Done with ${PREFIX}/etc/rc.d/zope.sh." ; \
${CAT} ${FILESDIR}/Message ; \
diff --git a/www/zope211/files/zope.sh.in b/www/zope211/files/zope.sh.in
new file mode 100644
index 000000000000..156a319c8125
--- /dev/null
+++ b/www/zope211/files/zope.sh.in
@@ -0,0 +1,17 @@
+#!/bin/sh
+
+case "$1" in
+start)
+ %%ZOPEBASEDIR%%/start -w '' -f '' -m '' -p %%CGI_BIN_DIR%%/Zope.cgi &
+ echo -n " Zope"
+ ;;
+stop)
+ %%ZOPEBASEDIR%% stop
+ echo -n " Zope"
+ ;;
+*)
+ echo "Usage: `basename $0` {start|stop}" >&2
+ ;;
+esac
+
+exit 0
diff --git a/www/zope213/Makefile b/www/zope213/Makefile
index 11ec49d80dca..21e3eb68c7c6 100644
--- a/www/zope213/Makefile
+++ b/www/zope213/Makefile
@@ -65,9 +65,8 @@ do-install: #
${ECHO} "===> Please have a look at this file and the instructions" ; \
${ECHO} "===> therein and incorporate them to your apache.conf." ; \
${ECHO} "===> Creating rc startup file for Zope-${PORTVERSION}..." ; \
- ${ECHO} "#! /bin/sh" > ${PREFIX}/etc/rc.d/zope.sh ; \
- ${ECHO} "${ZOPEBASEDIR}/start -w '' -f '' -m '' -p ${CGI_BIN_DIR}/Zope.cgi &" >> ${PREFIX}/etc/rc.d/zope.sh ; \
- ${ECHO} "echo -n \" Zope\"" >> ${PREFIX}/etc/rc.d/zope.sh ; \
+ ${SED} -e "s|%%ZOPEBASEDIR%%|${ZOPEBASEDIR}|g" -e "s|%%CGI_BIN_DIR%%|${CGI_BIN_DIR}|g" \
+ < ${FILESDIR}/zope.sh.in > ${PREFIX}/etc.rc.d/zope.sh; \
${CHMOD} ug+x,o-rwx ${PREFIX}/etc/rc.d/zope.sh ; \
${ECHO} "===> Done with ${PREFIX}/etc/rc.d/zope.sh." ; \
${CAT} ${FILESDIR}/Message ; \
diff --git a/www/zope213/files/zope.sh.in b/www/zope213/files/zope.sh.in
new file mode 100644
index 000000000000..156a319c8125
--- /dev/null
+++ b/www/zope213/files/zope.sh.in
@@ -0,0 +1,17 @@
+#!/bin/sh
+
+case "$1" in
+start)
+ %%ZOPEBASEDIR%%/start -w '' -f '' -m '' -p %%CGI_BIN_DIR%%/Zope.cgi &
+ echo -n " Zope"
+ ;;
+stop)
+ %%ZOPEBASEDIR%% stop
+ echo -n " Zope"
+ ;;
+*)
+ echo "Usage: `basename $0` {start|stop}" >&2
+ ;;
+esac
+
+exit 0
diff --git a/www/zope28/Makefile b/www/zope28/Makefile
index 11ec49d80dca..21e3eb68c7c6 100644
--- a/www/zope28/Makefile
+++ b/www/zope28/Makefile
@@ -65,9 +65,8 @@ do-install: #
${ECHO} "===> Please have a look at this file and the instructions" ; \
${ECHO} "===> therein and incorporate them to your apache.conf." ; \
${ECHO} "===> Creating rc startup file for Zope-${PORTVERSION}..." ; \
- ${ECHO} "#! /bin/sh" > ${PREFIX}/etc/rc.d/zope.sh ; \
- ${ECHO} "${ZOPEBASEDIR}/start -w '' -f '' -m '' -p ${CGI_BIN_DIR}/Zope.cgi &" >> ${PREFIX}/etc/rc.d/zope.sh ; \
- ${ECHO} "echo -n \" Zope\"" >> ${PREFIX}/etc/rc.d/zope.sh ; \
+ ${SED} -e "s|%%ZOPEBASEDIR%%|${ZOPEBASEDIR}|g" -e "s|%%CGI_BIN_DIR%%|${CGI_BIN_DIR}|g" \
+ < ${FILESDIR}/zope.sh.in > ${PREFIX}/etc.rc.d/zope.sh; \
${CHMOD} ug+x,o-rwx ${PREFIX}/etc/rc.d/zope.sh ; \
${ECHO} "===> Done with ${PREFIX}/etc/rc.d/zope.sh." ; \
${CAT} ${FILESDIR}/Message ; \
diff --git a/www/zope28/files/zope.sh.in b/www/zope28/files/zope.sh.in
new file mode 100644
index 000000000000..156a319c8125
--- /dev/null
+++ b/www/zope28/files/zope.sh.in
@@ -0,0 +1,17 @@
+#!/bin/sh
+
+case "$1" in
+start)
+ %%ZOPEBASEDIR%%/start -w '' -f '' -m '' -p %%CGI_BIN_DIR%%/Zope.cgi &
+ echo -n " Zope"
+ ;;
+stop)
+ %%ZOPEBASEDIR%% stop
+ echo -n " Zope"
+ ;;
+*)
+ echo "Usage: `basename $0` {start|stop}" >&2
+ ;;
+esac
+
+exit 0
diff --git a/www/zope29/Makefile b/www/zope29/Makefile
index 11ec49d80dca..21e3eb68c7c6 100644
--- a/www/zope29/Makefile
+++ b/www/zope29/Makefile
@@ -65,9 +65,8 @@ do-install: #
${ECHO} "===> Please have a look at this file and the instructions" ; \
${ECHO} "===> therein and incorporate them to your apache.conf." ; \
${ECHO} "===> Creating rc startup file for Zope-${PORTVERSION}..." ; \
- ${ECHO} "#! /bin/sh" > ${PREFIX}/etc/rc.d/zope.sh ; \
- ${ECHO} "${ZOPEBASEDIR}/start -w '' -f '' -m '' -p ${CGI_BIN_DIR}/Zope.cgi &" >> ${PREFIX}/etc/rc.d/zope.sh ; \
- ${ECHO} "echo -n \" Zope\"" >> ${PREFIX}/etc/rc.d/zope.sh ; \
+ ${SED} -e "s|%%ZOPEBASEDIR%%|${ZOPEBASEDIR}|g" -e "s|%%CGI_BIN_DIR%%|${CGI_BIN_DIR}|g" \
+ < ${FILESDIR}/zope.sh.in > ${PREFIX}/etc.rc.d/zope.sh; \
${CHMOD} ug+x,o-rwx ${PREFIX}/etc/rc.d/zope.sh ; \
${ECHO} "===> Done with ${PREFIX}/etc/rc.d/zope.sh." ; \
${CAT} ${FILESDIR}/Message ; \
diff --git a/www/zope29/files/zope.sh.in b/www/zope29/files/zope.sh.in
new file mode 100644
index 000000000000..156a319c8125
--- /dev/null
+++ b/www/zope29/files/zope.sh.in
@@ -0,0 +1,17 @@
+#!/bin/sh
+
+case "$1" in
+start)
+ %%ZOPEBASEDIR%%/start -w '' -f '' -m '' -p %%CGI_BIN_DIR%%/Zope.cgi &
+ echo -n " Zope"
+ ;;
+stop)
+ %%ZOPEBASEDIR%% stop
+ echo -n " Zope"
+ ;;
+*)
+ echo "Usage: `basename $0` {start|stop}" >&2
+ ;;
+esac
+
+exit 0