# $Id: Portfile 53548 2009-07-08 01:53:57Z ryandesign@macports.org $
PortSystem		1.0

name			fping
epoch			1
version			2.4b2
categories		net
maintainers		nomaintainer
platforms		darwin
homepage		http://www.fping.com
master_sites	http://unfix.org/projects/ipv6/
distname	${name}-${version}_to-ipv6
checksums  		md5 b1f10f88afd35b94846bfb0844d7a834
description		A scriptable ping program to check if multiple hosts are up
long_description	fping is different from ping in that you can specify \
					any number of hosts on the command line, or specify \
					a file containing the lists of hosts to ping. \
					Instead of trying one host until it timeouts or \
					replies, fping will send out a ping packet and move \
					on to the next host in a round-robin fashion. If a \
					host replies, it is noted and removed from the list \
					of hosts to check. If a host does not respond within \
					a certain time limit and/or retry limit it will be \
					considered unreachable. 

configure.args	--mandir="${prefix}/share/man"

post-destroot {
	system "ln -s fping.8 ${destroot}${prefix}/share/man/man8/fping6.8"
	# Check if user is running as root
	if {$env(USER) == "root"} {
		system "chmod 4511 ${destroot}${prefix}/sbin/fping"
		system "chmod 4511 ${destroot}${prefix}/sbin/fping6"
	} else {
		ui_msg "-----------------------------------------------------------"
		ui_msg "Note that you are not running as root, so ${name} cannot"
		ui_msg "be installed setuid root. Therefore, it will only be able"
		ui_msg "to be executed by root."
		ui_msg "-----------------------------------------------------------"
		system "chmod 0511 ${destroot}${prefix}/sbin/fping"
		system "chmod 0511 ${destroot}${prefix}/sbin/fping6"
	}
}

