1
0
Fork 0
mirror of https://github.com/Ysurac/openmptcprouter-feeds.git synced 2025-02-14 19:41:51 +00:00

Test if VPS support AES also

This commit is contained in:
Ycarus (Yannick Chabanois) 2019-06-16 07:41:45 +02:00
parent 9094e3d79d
commit fff32acf1d

View file

@ -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