#!/usr/bin/sh #---------------------------------------------------------------------------- # /usr/libexec/netconfig/bridge-dhcpdr - handle bridge stop/start # also special handling if dhcpd enabled to start with the correct interface # # Creation : 2024-08-24 hbfl # Last Update: $Id$ # # Copyright (c) 2001-@@YEAR@@ eisfair team, team(at)eisfair(dot)org # # 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. #---------------------------------------------------------------------------- # --------------------------------------------------------------------------- # check dhcpd: # if running than create a new dhcpd config # and restart dhcpd.service with the correct interface # --------------------------------------------------------------------------- check_dhcpd() { dhcpdlib='/var/install/include/dhcpdlib' if [ -f "${dhcpdlib}" ] then . "${dhcpdlib}" return ${?} else return 0 fi } # --------------------------------------------------------------------------- # start bonding # --------------------------------------------------------------------------- bridge_start() { /usr/sbin/service ${quiet} start bridge # check if running check_dhcpd # show anykey ${anykey} } # --------------------------------------------------------------------------- # stop bonding # --------------------------------------------------------------------------- bridge_stop() { /usr/sbin/service ${quiet} stop bridge.service /usr/libexec/netconfig/bridge stop # give a little time ;-) sleep 3 # restore base settings . /var/install/include/restore-ip-eth . /var/install/include/restore-route # check if running check_dhcpd # show anykey ${anykey} } # --------------------------------------------------------------------------- # main # --------------------------------------------------------------------------- main() { while [ ${#} -gt 0 ] do case "${1}" in -q|--quiet) quiet='--quiet' shift ;; --show) # include eislib for anykey # show anykey, when action over init task (menu script) . /var/install/include/eislib anykey=anykey shift ;; *) _action=${1} shift ;; esac done case "${_action}" in --start) bridge_start ;; --stop) # include base config to restore default settings . /etc/config.d/base bridge_stop ;; esac exit 0 } # --------------------------------------------------------------------------- # exec main # --------------------------------------------------------------------------- main "${@}" # --------------------------------------------------------------------------- # end # ---------------------------------------------------------------------------