#!/bin/bash
###############################################################################
#
#   Filename:		wview-install-macosx
#
#   Description:	Install wview on a new Mac OSX server.
#
#   Notes:              Must be run with root privileges: 
#                       sudo ./wview-install-macosx
#
#                       Make sure this script is executable: 
#                       chmod +x wview-install-macosx
#
#                       Uses the $prefix of "/opt/local" thus wview config will
#                       be found at /opt/local/etc/wview and wview data will be
#                       found at /opt/local/var/wview.
###############################################################################

# First, update the ports info:
port -d selfupdate

# Update existing installed ports:
port upgrade outdated

# Install wview (will also install all prerequisites):
port install wview

echo "Configuring wview:"
/opt/local/bin/wviewconfig

echo "Configuring HTML:
/opt/local/bin/wviewhtmlconfig

echo "Starting wview:"
/sbin/SystemStarter start "wview"

echo "Done! - Check your system logs (sudo tail -n 100 -f /var/log/system.log) for wview start up status..."
