/
Portfile
40 lines (34 loc) · 1.28 KB
/
Portfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
PortSystem 1.0
name icmpmonitor
version 1.2
categories net
license GPL-2+
platforms darwin
maintainers nomaintainer
description simple network monitor using icmp to check for hosts
long_description Using the InterNet Control Message Protocol (ICMP) "ECHO" \
facility, monitors several hosts, and notify admin if some of them \
are down.
homepage http://icmpmonitor.sourceforge.net/
master_sites sourceforge
checksums md5 c6c9bfc14f914604232945185be387b3
patchfiles patch-icmpmonitor.c
post-patch {
reinplace "s|__ETCDIR__|${prefix}/etc|g" ${worksrcpath}/icmpmonitor.c
}
configure.args --mandir=\\\${prefix}/share/man
destroot.destdir prefix=${destroot}${prefix}
post-destroot {
xinstall -m 755 -d ${destroot}${prefix}/share/doc/${name} \
${destroot}${prefix}/var/run/
xinstall -m 644 ${worksrcpath}/sample.cfg \
${destroot}${prefix}/etc/icmpmonitor.cfg.sample
xinstall -m 644 -W ${worksrcpath} ChangeLog NEWS README TODO \
${destroot}${prefix}/share/doc/${name}
system "touch ${destroot}${prefix}/var/run/icmpmonitor.pid"
}
startupitem.create yes
startupitem.init \
"PID=${prefix}/var/run/${name}.pid\nBIN=${prefix}/sbin/icmpmonitor"
startupitem.start "\[ -x \${BIN} \] && \${BIN} &; echo \$! > \${PID}"
startupitem.stop "\[ -r \${PID} \] && /bin/kill \$(cat \${PID})"