From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michael Tremer To: development@lists.ipfire.org Subject: Re: [PATCH 3/5] network initscript: Use network_zone_exists Date: Mon, 11 Mar 2024 17:02:48 +0000 Message-ID: In-Reply-To: <20240302110928.10377-3-jonatan.schlag@ipfire.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============4204042312049431716==" List-Id: --===============4204042312049431716== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Hello, Can we no rewrite this entire script? Even after your fix, I am very unhappy = with it. -Michael > On 2 Mar 2024, at 11:09, Jonatan Schlag wrote: >=20 > This only a cosmetic change but should making the code easier changeable > later on. >=20 > Signed-off-by: Jonatan Schlag > --- > src/initscripts/system/network | 12 +++++++----- > 1 file changed, 7 insertions(+), 5 deletions(-) >=20 > diff --git a/src/initscripts/system/network b/src/initscripts/system/network > index 0dcce060f..f334561de 100644 > --- a/src/initscripts/system/network > +++ b/src/initscripts/system/network > @@ -21,6 +21,8 @@ >=20 > . /etc/sysconfig/rc > . ${rc_functions} > +. /etc/init.d/networking/functions.network > + > eval $(/usr/local/bin/readhash /var/ipfire/ethernet/settings) >=20 > DO=3D"${1}" > @@ -54,11 +56,11 @@ case "${DO}" in > [ "$green" =3D=3D "1" ] && /etc/rc.d/init.d/networking/green start >=20 > # BLUE > - [ "$blue" =3D=3D "1" ] && [ "$CONFIG_TYPE" =3D "3" -o "$CONFIG_TYPE" =3D = "4" ] && \ > + [ "$blue" =3D=3D "1" ] && network_zone_exists "blue" && \ > /etc/rc.d/init.d/networking/blue start >=20 > # ORANGE > - [ "$orange" =3D=3D "1" ] && [ "$CONFIG_TYPE" =3D "2" -o "$CONFIG_TYPE" = =3D "4" ] && \ > + [ "$orange" =3D=3D "1" ] && network_zone_exists "orange" && \ > /etc/rc.d/init.d/networking/orange start >=20 > # RED > @@ -84,16 +86,16 @@ case "${DO}" in > [ "$green" =3D=3D "1" ] && /etc/rc.d/init.d/networking/green stop >=20 > # BLUE > - [ "$blue" =3D=3D "1" ] && [ "$CONFIG_TYPE" =3D "3" -o "$CONFIG_TYPE" =3D = "4" ] && \ > + [ "$blue" =3D=3D "1" ] && network_zone_exists "blue" && \ > /etc/rc.d/init.d/networking/blue stop >=20 > # ORANGE > - [ "$orange" =3D=3D "1" ] && [ "$CONFIG_TYPE" =3D "2" -o "$CONFIG_TYPE" = =3D "4" ] && \ > + [ "$orange" =3D=3D "1" ] && network_zone_exists "orange" && \ > /etc/rc.d/init.d/networking/orange stop >=20 > # RED > if [ "$red" =3D=3D "1" ]; then > - if [ "$CONFIG_TYPE" =3D "1" -o "$CONFIG_TYPE" =3D "2" -o "$CONFIG_TYPE" = =3D "3" -o "$CONFIG_TYPE" =3D "4" ]; then > + if network_zone_exists "red"; then > /etc/rc.d/init.d/networking/red stop > fi > fi > --=20 > 2.39.2 >=20 --===============4204042312049431716==--