#!/bin/sh
#
# Start conf check
#

case "$1" in
  start)
	[ -f /usr/local/sbin/checkApacheConf.sh ] && checkApacheConf.sh
	if [ "`/usr/local/sbin/getServiceStartup.sh twonky`" == "enabled" ]; then
		/sbin/refresh_contentdirs.sh &
	fi
	isInternalDriveRegister=`/usr/local/sbin/getMediaCrawlerStatus.sh | wc -l`
	if [ ${isInternalDriveRegister} -lt 6 ]; then
		/etc/init.d/S85wdmcserverd restart
	fi
	chmod 644 /etc/logrotate.conf
	chmod -R 644 /etc/logrotate.d
	cat /usr/local/sbin/socStandby.sh
	cat /usr/local/sbin/DisableWakeOnWifi.sh
	cat /usr/local/sbin/ResumeWifi.sh
	;;
  stop)
	;;
  restart|reload)
	;;
	
  *)
	echo "Usage: $0 {start|stop|restart}"
	exit 1
esac

exit $?
