From 2ec663a79fb0d3affba070a6ca93304d68ba04c4 Mon Sep 17 00:00:00 2001 From: fauno Date: Mon, 14 Jun 2021 19:36:57 -0300 Subject: [PATCH] no hardcodear el nombre de la red --- lib/exec/status | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/lib/exec/status b/lib/exec/status index f91dfd7..01ab2e5 100755 --- a/lib/exec/status +++ b/lib/exec/status @@ -62,14 +62,14 @@ fi # Servicio de tinc@rap (si existe el principal) if [ "${notincsv}" != true ]; then - tincrapsvstatus="$(systemctl status tinc@rap || :)" + tincrapsvstatus="$(systemctl status tinc@${NETWORK} || :)" if [ -z "${tincrapsvstatus}" ]; then - msg_orange "No se encontró el servicio de tinc@rap" + msg_orange "No se encontró el servicio de tinc@${NETWORK}" else - tincsv="$(systemctl show tinc@rap)" + tincsv="$(systemctl show tinc@${NETWORK})" echo "${tincsv}" | grep -q UnitFileState=enabled && enabled=si || enabled=no echo "${tincsv}" | grep -q ActiveState=active && active=si || active=no - msgtxt="Se encontró el servicio de tinc@rap: inicio en arranque=${enabled}, activo ahora=${active}" + msgtxt="Se encontró el servicio de tinc@${NETWORK}: inicio en arranque=${enabled}, activo ahora=${active}" if [ "${active}" = si ]; then msg "${msgtxt}" else msg_orange "${msgtxt}"; fi fi @@ -78,25 +78,25 @@ fi # Interface de red iplink="$(ip link show "${NETWORK}" 2>/dev/null || :)" if [ -z "${iplink}" ]; then - msg_orange "No se encontró la interface de red de la rap" + msg_orange "No se encontró la interface de red de la ${NETWORK}" else echo "${iplink}" | grep -q 'state UNKNOWN' && interface=true || interface=false if [ "${interface}" != true ]; then - msg_orange "Interface de red de la rap encontrada, pero caída" + msg_orange "Interface de red de la ${NETWORK} encontrada, pero caída" else - msg "Interface de red de la rap encontrada y andando" + msg "Interface de red de la ${NETWORK} encontrada y andando" # IPv6 local ipaddress="$(ip address show "${NETWORK}" | grep inet6 | tr -s ' ' | cut -d' ' -f3)" if [ -z "${ipaddress}" ]; then - msg_orange "No se encontró ninguna IP de rap" + msg_orange "No se encontró ninguna IP de ${NETWORK}" elif [ "$(echo "${ipaddress}" | wc -l)" -eq 1 ]; then msg_orange "Se encontró una sola IP: ${ipaddress}" else iprap="$(echo "${ipaddress}" | grep "${ULA_PREFIX}" || :)" if [ -z "${iprap}" ]; then - msg_orange "Se encontraron varias IPs de rap, pero ninguna válida" + msg_orange "Se encontraron varias IPs de ${NETWORK}, pero ninguna válida" else - msg "Tu IP de rap es: ${iprap}" + msg "Tu IP de ${NETWORK} es: ${iprap}" fi fi fi