#!/usr/bin/sh #---------------------------------------------------------------------------- # /var/install/bin/dhcpc-show-ip-status # # Creation: 2025-11-05 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. #---------------------------------------------------------------------------- . /etc/config.d/dhcpc . /etc/config.d/base # include eislib . /var/install/include/eislib # --------------------------------------------------------------------------- # check status of dhcpc # --------------------------------------------------------------------------- get_device() { eval ethx=${DHCPC_BIND_ETH} eval dhcpc_iface='${IP_ETH_'${ethx}'_NAME}' if [ -z "${dhcpc_iface}" ] then . /var/install/include/nm-get-device-name get_name eth0 dhcpc_iface="${name}" fi } # --------------------------------------------------------------------------- # show # --------------------------------------------------------------------------- show() { mecho --info 'Status service ...' if [ -f '/etc/sysconfig/network/active/dhcpc' ] then get_device mecho --std ' * Dhcpc is running ...' echo echo "-------------------------------------------------------------------" /usr/sbin/ip addr show ${dhcpc_iface} else mecho --warn ' * Dhcpc is not running ...' fi echo anykey } # --------------------------------------------------------------------------- # main # --------------------------------------------------------------------------- main() { show } # --------------------------------------------------------------------------- # exec main # --------------------------------------------------------------------------- main "${@}" # --------------------------------------------------------------------------- # end # ---------------------------------------------------------------------------