#!/usr/bin/sh #---------------------------------------------------------------------------- # /var/install/bin/bridge-show-ip-status # # Creation: 2023-01-03 hbfl # Last Update: $Id$ # # Copyright (c) 2014-@@YEAR@@ Holger Bruenjes, holgerbruenjes(at)gmx(dot)net # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. #---------------------------------------------------------------------------- . /var/install/include/eislib BRIDGE=/usr/sbin/bridge # --------------------------------------------------------------------------- # check status of bridge # --------------------------------------------------------------------------- check_bridge_status() { /usr/bin/grep -q '^bridge ' /proc/modules return ${?} } # --------------------------------------------------------------------------- # show # --------------------------------------------------------------------------- show() { mecho --info 'Status service ...' if check_bridge_status then mecho --std " * Bridge is running ..." echo ${BRIDGE} -d -p -color link show echo /usr/bin/ip -c addr show $(/usr/bin/nmcli con | /usr/bin/gawk '/bridge/ {print $1}') else mecho --warn " * Bridge is not running ..." fi echo anykey } # --------------------------------------------------------------------------- # main # --------------------------------------------------------------------------- main() { show } # --------------------------------------------------------------------------- # exec main # --------------------------------------------------------------------------- main "${@}" # --------------------------------------------------------------------------- # end # ---------------------------------------------------------------------------