mirror of
				https://github.com/Ysurac/openmptcprouter-feeds.git
				synced 2025-03-09 15:40:03 +00:00 
			
		
		
		
	Test if VPS support AES also
This commit is contained in:
		
							parent
							
								
									9094e3d79d
								
							
						
					
					
						commit
						fff32acf1d
					
				
					 1 changed files with 13 additions and 7 deletions
				
			
		|  | @ -563,13 +563,19 @@ _config_service() { | |||
| 	} | ||||
| 	_get_vps_config | ||||
| 	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 | ||||
| 			set shadowsocks-libev.sss0.method=aes-256-gcm | ||||
| 			commit shadowsocks-libev | ||||
| 		EOF | ||||
| 		[ -z "$vps_config" ] && vps_config=$(_get_json "config") | ||||
| 		[ -n "$vps_config" ] && { | ||||
| 			vps_aes="$(echo "$vps_config" | jsonfilter -q -e '@.vps.aes')" | ||||
| 			if [ "$vps_aes" != "false" ]; 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 | ||||
| 					set shadowsocks-libev.sss0.method=aes-256-gcm | ||||
| 					commit shadowsocks-libev | ||||
| 				EOF | ||||
| 			fi | ||||
| 		} | ||||
| 	fi | ||||
| 	uci -q set openmptcprouter.settings.firstboot=0 | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue