#!/bin/sh
script_path=`echo $0 | awk -F '/' '{for(i=2;i<NF;i++) printf"/"$i}'`
LCD_CFG=`cat $script_path/lcd.ini | ./busybox grep "lcd:" | sed 's/lcd://g' | sed 's/\r//g' | sed 's/\n//g' | sed "s/$(echo -e '\015')//g"`

if [ "$LCD_CFG" = "yes" ]; then
	[ -e "$script_path/lcd_cfg.json" ] && cp -f $script_path/lcd_cfg.json /mnt/mtd/Log/lcd_cfg.json
elif [ "$LCD_CFG" = "no" ]; then
	[ -e "/mnt/mtd/Log/lcd_cfg.json" ] && rm /mnt/mtd/Log/lcd_cfg.json
fi
