# fping 3.13
# ==========
# Get it
cd
test -f installed/fping-3.13.tar.gz && mv installed/fping-3.13.tar.gz .
test ! -f fping-3.13.tar.gz && wget http://fping.org/dist/fping-3.13.tar.gz
# Extract it
mkdir -p -m 0700 src
cd src
find -maxdepth 1 -type d -name "fping-*" -exec rm -r {} \;
tar xzvf ~/fping-3.13.tar.gz
cd fping-3.13
test $UID = 0 && chown -R root:root .
# Configure the build
./configure --mandir=/usr/local/man
# Build it
make
# Become root to install it
su
# Install it
make install
# Make it setuid root
chmod u+s /usr/local/sbin/fping
# Make sure your non-root user can remove the source later
chown -R $(logname) .
chmod -R u+w .
# Become your non-root user again
exit
# Save the tarball for later
cd
mkdir -p -m 0700 installed
rm -f installed/fping-*.tar.* installed/fping.tar.gz
mv fping-3.13.tar.gz installed/
# If you ever want to uninstall fping, this should do it:
cd
su
test -d src/fping-* && ( cd src/fping-* ; make uninstall )
rm -f /usr/local/sbin/fping /usr/local/man/man8/fping.8
exit
find ~/src -maxdepth 1 -type d -name "fping-*" -exec rm -r {} \;
rm -f ~/installed/fping-*.tar.* ~/installed/fping.tar.gz