#!/bin/sh
MEM=`free | awk '/Mem/ {print $2}'`
if [ "$MEM" -lt 80000 ] ; then
  rm -f -r /opt/packages/tm_cpps*.ipk > /dev/null 2>&1
fi
chmod 755 /etc/init.d/tm_serverd
chmod 755 /etc/init.d/hwclockd
find /usr/share/tm_cpps -exec chmod 755 {} \;
/etc/init.d/hwclockd enable
/etc/init.d/tm_serverd enable
/etc/init.d/hwclockd start > /dev/null 2>&1
/etc/init.d/tm_serverd start > /dev/null 2>&1

exit 0
