diff options
author | tg <tg@FreeBSD.org> | 2000-07-05 20:37:06 +0800 |
---|---|---|
committer | tg <tg@FreeBSD.org> | 2000-07-05 20:37:06 +0800 |
commit | 3a84881f168162a487490bbbd275ca05b7f5560d (patch) | |
tree | e888acd7e17d635c1f902fccb1eefdf89f15641a /games/quakeserver | |
parent | 83513fef56c1c9996eb040a93488ed7837fac927 (diff) | |
download | freebsd-ports-gnome-3a84881f168162a487490bbbd275ca05b7f5560d.tar.gz freebsd-ports-gnome-3a84881f168162a487490bbbd275ca05b7f5560d.tar.zst freebsd-ports-gnome-3a84881f168162a487490bbbd275ca05b7f5560d.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/quakeserver')
-rw-r--r-- | games/quakeserver/Makefile | 13 | ||||
-rw-r--r-- | games/quakeserver/files/quakeserver.sh | 21 |
2 files changed, 24 insertions, 10 deletions
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 |