mirror of
				https://github.com/Ysurac/openmptcprouter-feeds.git
				synced 2025-03-09 15:40:03 +00:00 
			
		
		
		
	Fix set AES by default
This commit is contained in:
		
							parent
							
								
									f5b1b641c7
								
							
						
					
					
						commit
						a9fc2eae7d
					
				
					 1 changed files with 11 additions and 14 deletions
				
			
		| 
						 | 
				
			
			@ -551,6 +551,17 @@ _config_service() {
 | 
			
		|||
	[ "$(uci -q get openmptcprouter.${servername}.get_config)" = "1" ] && {
 | 
			
		||||
		_set_config_from_vps
 | 
			
		||||
	}
 | 
			
		||||
	if [ "$(uci -q get openmptcprouter.settings.firstboot)" != "0" ] && [ -n "$(cat /proc/cpuinfo | grep aes)" ]; then
 | 
			
		||||
		logger -t "OMR-VPS" "CPU support AES, set it by default"
 | 
			
		||||
		uci -q batch <<-EOF >/dev/null
 | 
			
		||||
			set glorytun.vpn.chacha20=0
 | 
			
		||||
			commit glorytun
 | 
			
		||||
			shadowsocks-libev.sss0.method=aes-256-gcm
 | 
			
		||||
			commit shadowsocks-libev
 | 
			
		||||
		EOF
 | 
			
		||||
	fi
 | 
			
		||||
	uci -q set openmptcprouter.settings.firstboot=0
 | 
			
		||||
 | 
			
		||||
	_get_vps_config
 | 
			
		||||
	config_load shadowsocks-libev
 | 
			
		||||
	config_foreach _set_ss_server_vps server
 | 
			
		||||
| 
						 | 
				
			
			@ -567,20 +578,6 @@ _config_service() {
 | 
			
		|||
	EOF
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
boot() {
 | 
			
		||||
	if [ "$(uci -q get openmptcprouter.settings.firstboot)" != "0" ] && [ -n "$(cat /proc/cpuinfo | grep aes)" ]; then
 | 
			
		||||
		uci -q batch <<-EOF >/dev/null
 | 
			
		||||
			set glorytun.vpn.chacha20=0
 | 
			
		||||
			commit glorytun
 | 
			
		||||
			shadowsocks-libev.sss0.method=aes-256-gcm
 | 
			
		||||
			commit shadowsocks-libev
 | 
			
		||||
		EOF
 | 
			
		||||
	fi
 | 
			
		||||
	uci -q set openmptcprouter.settings.firstboot=0
 | 
			
		||||
	start "$@"
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
start_service() {
 | 
			
		||||
	serversnb=0
 | 
			
		||||
	config_load openmptcprouter
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue