1
0
Fork 0
mirror of https://github.com/Ysurac/openmptcprouter-feeds.git synced 2025-03-09 15:40:03 +00:00

Add more check in openmptcprouter-vps init script

This commit is contained in:
Ycarus (Yannick Chabanois) 2024-08-01 17:12:27 +02:00
parent 02145da5a6
commit 86edfa855d

View file

@ -79,6 +79,9 @@ _get_json() {
else
result=`curl --max-time 10 -s -k -H "accept: application/json" -H "Authorization: Bearer $token" https://[$server]:$serverport/$route`
fi
if [ "$(echo $result | grep 'Could not validate credentials')" ]; then
result=''
fi
echo $result
} || {
echo ''
@ -2264,6 +2267,8 @@ _config_service() {
[ -z "$vps_config" ] && vps_config=$(_get_json "config")
[ -z "$vps_config" ] && return
kernel="$(echo "$vps_config" | jsonfilter -q -e '@.vps.kernel')"
[ -z "$kernel" ] && return
user_permission="$(echo "$vps_config" | jsonfilter -q -e '@.user.permission')"
if [ "$user_permission" != "ro" ]; then