#!/bin/sh -e

pkgname="nagiosbpi"
installdir="/usr/local/nagios/share"
echo "Installing nagiosbpi..."

# Delete the old directory
#rm -rf "$pkgname"

# Make and install $pkgname
(
    cp -r "$pkgname" "$installdir"
    cd "$installdir/$pkgname"
    chmod +x set_bpi_perms.sh
    ./set_bpi_perms.sh
	
)


# Do a simple sanity check to make sure some key files exist...
if [ ! -f "$installdir/$pkgname/index.php" ]; then
    echo "ERROR: $pkgname install appears to have failed - exiting.  Missing file = $f"
    exit 1
fi

# Things are okay
echo "$pkgname installed OK"

