#!/bin/sh
# Copyright (c) 2000-2012 Synology Inc. All rights reserved.

PHPBBDIR="/var/services/web/phpbb"

tmp_path=/$(readlink /var/services/web|cut -d/ -f 2)/@tmp
cp -rf $tmp_path/phpbb/phpBB3/* $PHPBBDIR

#if configured! (config.php size > 0) remove install dir
if [ -s $PHPBBDIR/config.php ]; then
	rm -r $PHPBBDIR/.install
	mv -f $PHPBBDIR/install $PHPBBDIR/.install
fi

chown -R 1023:1023 $PHPBBDIR

exit 0
