#!/bin/sh
if [ -z "${IPKG_INSTROOT}" ]; then
	if grep -qE "[1-4]\.[0-6]\..+" /etc/glversion; then
		echo
		echo 'Your firmware version is lower than 4.7.0, please try a lower version'
		echo '您的固件版本低于4.7.0，请尝试较低版本的插件'
		echo
		exit 1
	fi
	sed -i '/cgi-bin/,/}/{/X-Frame-Options/d}' /etc/nginx/conf.d/gl.conf
	nginx -s reload 2> /dev/null
	echo
	echo 'Please go to "System > Customization" and click the Apply button after installation'
	echo '安装后请进入“系统 > 个性化”点击应用按钮'
	echo
fi
exit 0
