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:
parent
02145da5a6
commit
86edfa855d
1 changed files with 5 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue