Zeleza Posted June 30, 2022 Posted June 30, 2022 (edited) Собственно вопрос в теме сообщения. Edited June 30, 2022 by Zeleza Quote
0 Zeleza Posted June 30, 2022 Author Posted June 30, 2022 (edited) Доброго всем дня, Памяти ради и науки для, отвечаю сам себе на вопрос в теме. INFACE_PART_REQUEST='localhost:79/rci/interface' CMD_LIST="address prefix name-servers" # ------------------------------------------------------------------------------------------ # # Функция вЫключения IPv6 # $1 - CLI интерфейс # # ------------------------------------------------------------------------------------------ ipv6_inface_off(){ inface="${1}" for cmd in ${CMD_LIST}; do curl -s -d '{"auto":true,"no":true}' "${INFACE_PART_REQUEST}/${inface}/ipv6/${cmd}" &> /dev/null done } # ------------------------------------------------------------------------------------------ # # Функция включения IPv6 # $1 - CLI интерфейс # # ------------------------------------------------------------------------------------------ ipv6_inface_on(){ inface="${1}" for cmd in ${CMD_LIST}; do curl -s -d '{"auto":true}' "${INFACE_PART_REQUEST}/${inface}/ipv6/${cmd}" &> /dev/null done } # ------------------------------------------------------------------------------------------ # # Функция проверки статуса IPv6 # $1 - CLI интерфейс # Возвращает: # 0 - ipv6 подключен # 1 - ipv6 отключен # # ------------------------------------------------------------------------------------------ ipv6_status(){ inface="${1}"; res=0 for cmd in ${CMD_LIST}; do [ -n "$(curl -s "${INFACE_PART_REQUEST}/${inface}/ipv6/${cmd}" | grep true )" ] && res=$((res+1)) done if [ "${res}" -eq 3 ]; then echo 0; else echo 1; fi } Благодарю за помощь @eralde. Edited June 30, 2022 by Zeleza 1 Quote
Question
Zeleza
Собственно вопрос в теме сообщения.
Edited by Zeleza1 answer to this question
Recommended Posts
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.