#!/bin/sh

export LD_LIBRARY_PATH=/tmp/lib:$LD_LIBRARY_PATH:

cd /tmp/
chmod 777 web/images/*
chmod 777 web/css/*
chmod 777 web/js/*
chmod 777 web/*
chmod 777 ko/extdrv/*
chmod 777 ko/*
chmod 777 lib/*
chmod 777 *

chmod 777 avahi/sbin/*
chmod 777 dbus/bin/*

cd /
mkdir usb

cd /tmp/ko
./load3536c -a -total 1024 -osmem 256

telnetd&

echo 20480000 > /proc/sys/net/core/rmem_default
echo 40960000 > /proc/sys/net/core/rmem_max

cd /tmp/
chmod 777 reset 
chmod 777 box.d3
chmod 777 /tmp/nginx/sbin/nginx

ifconfig lo up
/tmp/nginx/sbin/nginx -p /tmp/nginx/
cp /box/factory.ini /tmp/factory.ini
./reset &
./box.d3
