#!/bin/bash

. "$(dirname "$0")/common"
DO_LINK

old_config_path=/usr/local/etc/httpd/sites-enabled
new_config_path=/usr/local/etc/apache24/sites-enabled

if [ ! -d "$new_config_path" ]; then
	/usr/bin/mkdir "$new_config_path"
fi

if [ -d "$old_config_path" ] && [ ! -L "$old_config_path" ]; then
	/usr/bin/cp -p "$old_config_path"/* "$new_config_path"
	/usr/bin/rm -r "$old_config_path"

	# legacy support
	/usr/bin/ln -s "$new_config_path" "$old_config_path"
fi

exit 0
