Kwrt icon indicating copy to clipboard operation
Kwrt copied to clipboard

7.26以后的新版本快捷访问不可用,希望可以重新添加这个功能

Open kingfingerpro opened this issue 1 year ago • 0 comments

检查脚本之后发现是新版本修改了 /etc/init.d/dnsmasq ,删除了一段代码导致的

	network_get_ipaddr lanaddr "lan"
	if [ -n $lanaddr ]; then
 	lanaddr="$(echo "$lanaddr" | sed -e "s/\/24//")"
	echo "
	$lanaddr op" >/tmp/hosts/shortcuts
	if [ -f /etc/nginx/conf.d/shortcuts.conf ]; then
	if [[ "$lanaddr" != "`grep "set \$ip" /etc/nginx/conf.d/shortcuts.conf | head -n1 | cut -f 3 -d " " | sed -e 's/;//'`" ]]; then
		sed -i "/set \$ip/c\set \$ip $lanaddr;" /etc/nginx/conf.d/shortcuts.conf
		/etc/init.d/nginx reload
	fi
	cat /etc/nginx/conf.d/shortcuts.conf | tr "\n" "\r" |grep -oE 'server_name [a-z.-]*;[^;]*set \$ip [0-9.]*;' | sed -e 's/server_name \(.*\);.*location.*set $ip \(.*\);/\2 \1/' >>/tmp/hosts/shortcuts
	cat /etc/nginx/conf.d/shortcuts.conf | tr "\n" "\r" |grep -oE 'server_name [a-z.-]*;[^;]*return 301 \$scheme://op' | sed -e 's/server_name \(.*\?\);.*/\1/' | sed -e "s/^/$lanaddr /">>/tmp/hosts/shortcuts
	fi
	fi

image 希望大佬能把这个功能加回来

kingfingerpro avatar Aug 22 '24 11:08 kingfingerpro