diff options
author | Kirill Ponomarev <krion@FreeBSD.org> | 2004-08-25 09:16:16 +0000 |
---|---|---|
committer | Kirill Ponomarev <krion@FreeBSD.org> | 2004-08-25 09:16:16 +0000 |
commit | 18d440944f92748a608f653b7b1b63b6e200bcdc (patch) | |
tree | c7c205b879f7e19aed654f15341e3780626cdd31 /misc/dnetc | |
parent | f8954066434d71bdbcf48584bd905ad1d13cd693 (diff) | |
download | ports-18d440944f92748a608f653b7b1b63b6e200bcdc.tar.gz ports-18d440944f92748a608f653b7b1b63b6e200bcdc.zip |
Notes
Diffstat (limited to 'misc/dnetc')
-rw-r--r-- | misc/dnetc/Makefile | 11 | ||||
-rw-r--r-- | misc/dnetc/files/dnetc.sh | 56 | ||||
-rw-r--r-- | misc/dnetc/pkg-plist | 2 |
3 files changed, 32 insertions, 37 deletions
diff --git a/misc/dnetc/Makefile b/misc/dnetc/Makefile index b3b025dfe06d..5e20ae3469c1 100644 --- a/misc/dnetc/Makefile +++ b/misc/dnetc/Makefile @@ -24,6 +24,7 @@ MD5_FILE= ${MASTERDIR}/distinfo.${ARCH} ONLY_FOR_ARCHS= i386 alpha sparc64 amd64 +USE_RC_SUBR= yes NO_BUILD= yes BINDIR= ${PREFIX}/distributed.net @@ -52,17 +53,15 @@ VERSION= 2.9008.491 IGNORE= "This port requires FreeBSD 3.X or greater." .endif -.if exists(${PREFIX}/distributed.net/rc5des) -BROKEN= "rc5des/dnetc conflict: Please deinstall all rc5des ports/packages first." -.endif - post-extract: @${SED} -e 's#%%CLIENTUSER%%#${CLIENTUSER}#g' -e 's#%%CLIENTGROUP%%#${CLIENTGROUP}#' \ -e 's#%%CLIENTUID%%#${CLIENTUID}#g' ${MASTERDIR}/pkg-install > ${PKGINSTALL} @${SED} -e 's#%%CLIENTUSER%%#${CLIENTUSER}#g' -e 's#%%CLIENTGROUP%%#${CLIENTGROUP}#' \ ${MASTERDIR}/pkg-deinstall > ${PKGDEINSTALL} @${SED} -e 's#%%BINDIR%%#${BINDIR}#' ${MASTERDIR}/pkg-message > ${PKGMESSAGE} - @${SED} -e 's#%%BINDIR%%#${BINDIR}#' -e 's#%%CLIENTUSER%%#${CLIENTUSER}#g' \ + @${SED} -e 's#%%BINDIR%%#${BINDIR}#' \ + -e 's#%%CLIENTUSER%%#${CLIENTUSER}#g' \ + -e 's#%%RC_SUBR%%#${RC_SUBR}#g' \ ${FILESDIR}/dnetc.sh > ${WRKDIR}/dnetc.sh do-configure: @@ -86,7 +85,7 @@ do-install: ${INSTALL_DATA} ${FILESDIR}/INFO ${BINDIR} ${INSTALL_MAN} ${WRKSRC}/${MAN1} ${PREFIX}/man/man1 - ${INSTALL_SCRIPT} ${WRKDIR}/dnetc.sh ${PREFIX}/etc/rc.d/dnetc.sh.sample + ${INSTALL_SCRIPT} ${WRKDIR}/dnetc.sh ${PREFIX}/etc/rc.d/dnetc.sh ${INSTALL} -c -m 644 -o ${CLIENTUSER} -g ${CLIENTGROUP} ${WRKSRC}/dnetc.ini ${BINDIR}/dnetc.ini.sample .if !exists(${BINDIR}/dnetc.ini) diff --git a/misc/dnetc/files/dnetc.sh b/misc/dnetc/files/dnetc.sh index ed7c39e4fe6f..1b8af10307f7 100644 --- a/misc/dnetc/files/dnetc.sh +++ b/misc/dnetc/files/dnetc.sh @@ -1,41 +1,37 @@ #!/bin/sh +# +# $FreeBSD$ +# +# PROVIDE: dnetc +# REQUIRE: LOGIN +# KEYWORD: FreeBSD shutdown + +dnetc_enable=${dnetc_enable:-"NO"} dir="%%BINDIR%%" user="%%CLIENTUSER%%" -case "$1" in -start) - if [ ! -d $dir ]; then - logger -i "dnetc client directory doesn't exist. ($dir)." - exit - fi +. %%RC_SUBR%% - if [ ! -f $dir/dnetc ]; then - logger -i "dnetc client doesn't exist. ($dir/dnetc)." - exit - fi +name="dnetc" +rcvar=`set_rcvar` - if [ ! -f $dir/dnetc.ini ]; then - logger -i "dnetc client config file doesn't exist. ($dir/dnetc.ini)." - exit - fi +required_files=${dir}/dnetc.ini - email=`grep "^id=" $dir/dnetc.ini|cut -d"=" -f2` +start_cmd="${name}_start" +stop_cmd="${name}_stop" - if [ "$email" = "rc5@distributed.net" ]; then - logger -i "dnetc client running with default email address. ($email)" - fi +dnetc_start() +{ + echo -n " dnetc" + su -m ${user} -c "${dir}/dnetc -quiet" 2>/dev/null >/dev/null +} +dnetc_stop() +{ echo -n " dnetc" - su -m $user -c "$dir/dnetc -quiet" 2>/dev/null >/dev/null & - ;; -stop) - killall -u $user dnetc && echo -n " dnetc" - ;; -*) - echo "Usage: `basename $0` {start|stop}" >&2 - exit 64 - ;; -esac - -exit 0 + su -m ${user} -c "${dir}/dnetc -shutdown" 2>/dev/null >/dev/null +} + +load_rc_config $name +run_rc_command "$1" diff --git a/misc/dnetc/pkg-plist b/misc/dnetc/pkg-plist index a621da54a467..2c708af56079 100644 --- a/misc/dnetc/pkg-plist +++ b/misc/dnetc/pkg-plist @@ -3,5 +3,5 @@ distributed.net/INFO @unexec if cmp -s %D/distributed.net/dnetc.ini %D/distributed.net/dnetc.ini.sample; then rm -f %D/distributed.net/dnetc.ini; fi distributed.net/dnetc.ini.sample @exec [ -f %B/dnetc.ini ] || cp %B/%f %B/dnetc.ini -etc/rc.d/dnetc.sh.sample +etc/rc.d/dnetc.sh @dirrm distributed.net |