diff options
author | Thomas Gellekum <tg@FreeBSD.org> | 2000-07-05 12:37:06 +0000 |
---|---|---|
committer | Thomas Gellekum <tg@FreeBSD.org> | 2000-07-05 12:37:06 +0000 |
commit | 546041ba3113a4a58d8f3e7e7cb90e78fcb38ea8 (patch) | |
tree | 7b9cd553a62be7a9bd52800d334be8b703eb93a1 /games | |
parent | 01ab6da99c55af36e516b7f8016373124c4039cf (diff) | |
download | freebsd-ports-546041ba3113a4a58d8f3e7e7cb90e78fcb38ea8.zip |
As threatened on freebsd-ports: all startup scripts know about the two
options `start' and `stop' now (unless I have forgotten any). This allows
us to call the scripts from /etc/rc.shutdown with the correct option.
The (42 or so) ports that already DTRT before are unchanged.
Diffstat (limited to 'games')
-rw-r--r-- | games/bnetd/Makefile | 5 | ||||
-rw-r--r-- | games/bnetd/files/bnetd.sh | 20 | ||||
-rw-r--r-- | games/quakeserver/Makefile | 13 | ||||
-rw-r--r-- | games/quakeserver/files/quakeserver.sh | 21 | ||||
-rw-r--r-- | games/tetrinet-x/files/tetrinet-x.sh | 18 | ||||
-rw-r--r-- | games/uox3/files/uox3.sh | 21 |
6 files changed, 79 insertions, 19 deletions
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 |