Jump to content

Recommended Posts

Posted (edited)

Доброго всем дня

Уважаемые гуру, прошу Вашей посильной помощи.

Вопрос в следующем: что произошло с командой curl -s localhost:79/rci/show/rc/ppe в новой прошивке >4.1 и как теперь определить какой тип ускорения сейчас используется роутером?

Ранее, я использовал функции ниже для определения типа ускорения

fast_hw_enabled()(! curl -s localhost:79/rci/show/rc/ppe | grep hardware -C1 | grep -q false)
fast_sw_enabled()(! curl -s localhost:79/rci/show/rc/ppe | grep software -C1 | grep -q false)

И в ответах всегда фигурировали флаги true и false, сейчас такого нет в ответах curl -s localhost:79/rci/show/rc/ppe.

Может, кто в курсе, как сейчас программно определить тип ускорения. 

@Le ecureuil, может Вы знаете, ответ на данный вопрос?

Edited by Zeleza
  • Zeleza changed the title to Как определить тип ускорения используемый роутером в KeeneticOS >4.1
Posted

KN-2110:

root@Keenetic_Duo:~# ndmc -c show version | grep -E '(release|title)'
          release: 4.02.A.3.0-0
            title: 4.2 Alpha 3
root@Keenetic_Duo:~#

disabled

root@Keenetic_Duo:~# 
root@Keenetic_Duo:~# curl -s localhost:79/rci/show/rc/ppe
[
  {
    "engine": "software"
  },
  {
    "enabled": false,
    "engine": "hardware"
  }
root@Keenetic_Duo:~# ndmc -c show rc ppe | grep -B1 hard | grep enabled
              enabled: no
root@Keenetic_Duo:~# 
root@Keenetic_Duo:~# if [ -z "$(ndmc -c show rc ppe | grep -B1 hard | grep enabled)" ]; then echo "hardware enabled"; else echo "hardware disabled"; fi
hardware disabled
root@Keenetic_Duo:~#

enabled

root@Keenetic_Duo:~# 
root@Keenetic_Duo:~# curl -s localhost:79/rci/show/rc/ppe
[
  {
    "engine": "software"
  },
  {
    "engine": "hardware"
  }
]root@Keenetic_Duo:~# 
root@Keenetic_Duo:~# ndmc -c show rc ppe | grep -B1 hard | grep enabled
root@Keenetic_Duo:~# 
root@Keenetic_Duo:~# if [ -z "$(ndmc -c show rc ppe | grep -B1 hard | grep enabled)" ]; then echo "hardware enabled"; else echo "hardware disabled"; fi
hardware enabled
root@Keenetic_Duo:~# 

 

  • Thanks 1
Posted
4 минуты назад, TheBB сказал:

disabled

Логику понял.
Благодарю.

Posted

на всякий случай - из ZyXEL Keenetic Ultra II

 ~  # ndmc -c show rc ppe

           config, name = ppe: 
               engine: hardware

 ~  # 
 ~  # ndmc -c show rc ppe

           config, name = ppe: 
                   no: 
              enabled: no
               engine: hardware

 ~  # 

 

  • Thanks 1
Posted (edited)

Обновленные функции определения выглядят теперь так:

version_keen_os()(ndmc -c show version | grep version | head -1 | cut -d: -f2| tr -d ' ')
is_os_4()([[ "$(version_keen_os)" =~ 4.* ]])
# ------------------------------------------------------------------------------------------
# проверка на доступность программного и аппаратного ускорения
# ------------------------------------------------------------------------------------------
fast_hw_enabled()(flag=false; is_os_4 && flag=enable; ! curl -s localhost:79/rci/show/rc/ppe | grep hardware -C1 | grep -q ${flag})
fast_sw_enabled()(flag=false; is_os_4 && flag=enable; ! curl -s localhost:79/rci/show/rc/ppe | grep software -C1 | grep -q ${flag})

fastnet_enabled()(fast_hw_enabled || fast_sw_enabled)
fastnet_support()(curl -s localhost:79/rci/show/version | grep -q ppe)
Edited by Zeleza
Posted
1 час назад, TheBB сказал:

на всякий случай - из ZyXEL Keenetic Ultra II

 ~  # ndmc -c show rc ppe

           config, name = ppe: 
               engine: hardware

 ~  # 
 ~  # ndmc -c show rc ppe

           config, name = ppe: 
                   no: 
              enabled: no
               engine: hardware

 ~  # 

 

На 42A4 на ARM

~ # ndmc -c show rc ppe

           config, name = ppe: 
               engine: software

           config, name = ppe: 
               engine: hardware

~ # 

 

  • Thanks 1
Posted

KN-2710 в режиме extender-ретранслятор (как и ZKU2 выше)

 ~  # ndmc -c show rc ppe

           config, name = ppe: 
               engine: hardware

 ~  # 
 ~  # ndmc -c show rc ppe

           config, name = ppe: 
                   no: 
              enabled: no
               engine: hardware

 ~  # 

 

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

This site uses cookies. By clicking "I accept" or continuing to browse the site, you authorize their use in accordance with the Privacy Policy.