#!/bin/sh

[ -z "$ROOT" ] && ROOT=/www
CONFIG=$ROOT/config
SCRIPT=$ROOT/script
TYPE=$ROOT/models
DATA=/data

# Init model
sh $TYPE/init.sh

echo "  Init sysctl"
cp $CONFIG/sysctl.conf /etc
sysctl -p

chmod +x -R $SCRIPT

echo "  Init ng_ap2"
cp $SCRIPT/ng_ap2 /etc/init.d/
/etc/init.d/ng_ap2 enable

# Disable firewall if exists
if [ ! -z "`ls -1 /etc/rc.d/ | grep firewall`" ] ; then
	/etc/init.d/firewall disable
fi

exit 0
