#!/usr/bin/sh #---------------------------------------------------------------------------- # /var/install/bin/bonding-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. #---------------------------------------------------------------------------- # include eislib . /var/install/include/eislib # --------------------------------------------------------------------------- # check status of bonding # --------------------------------------------------------------------------- check_bonding_status() { /usr/bin/grep -q '^bonding ' /proc/modules return ${?} } # --------------------------------------------------------------------------- # show # --------------------------------------------------------------------------- show() { mecho --info 'Status service ...' if check_bonding_status then mecho --std ' * Bonding is running ...' echo for _bond in $(/usr/bin/cat /sys/class/net/bonding_masters) do echo "-------------------------------------------------------------------" /usr/sbin/ip -c addr show ${_bond} done else mecho --warn ' * Bonding is not running ...' fi echo anykey } # --------------------------------------------------------------------------- # main # --------------------------------------------------------------------------- main() { show } # --------------------------------------------------------------------------- # exec main # --------------------------------------------------------------------------- main "${@}" # --------------------------------------------------------------------------- # end # ---------------------------------------------------------------------------