#!/bin/sh

script_path=`echo $0 | awk -F '/' '{for(i=2;i<NF;i++) printf"/"$i}'`
echo $script_path

LampCamera=`cat $script_path/lampCamera.ini | ./busybox grep "lampCamera:" | ./busybox grep -v grep | sed 's/lampCamera://g' | sed 's/\r//g' | sed 's/\n//g' | sed "s/$(echo -e '\015')//g"`

if [ $? != 0 ]; then
	echo "cann't found lampCamera ini config file"
	exit -1
fi

if [ "$LampCamera" = "yes" ];then
	if [ ! -d "/mnt/mtd/Flags/" ];then
		mkdir -p /mnt/mtd/Flags/
	fi
	touch /mnt/mtd/Flags/LampCameraCustomFlag 
fi

if [ "$LampCamera" = "no" ];then
	rm -f /mnt/mtd/Flags/LampCameraCustomFlag 
fi