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: Sat, 16 Mar 2024 11:25:07 +0000 Message-ID: In-Reply-To: <0aaffd5600877f2f1a58a95855358872@ipfire.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============2225870361110553844==" List-Id: --===============2225870361110553844== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Okay, keep them coming then :) > On 16 Mar 2024, at 09:46, Jonatan Schlag wrot= e: >=20 >=20 > Hi, >=20 > This will happen. But you do not seem to want too many patches at once, so = I started to gradually improve it, to avoid a full rewrite. I currently have = some trouble getting your point, how big a patch series or the changes should= be. Because both ways, full rewrite and gradually improving it seem to be wr= ong. >=20 > Jonatan >=20 >=20 > Am 2024-03-11 18:02, schrieb Michael Tremer: >> Hello, >> Can we no rewrite this entire script? Even after your fix, I am very unhap= py with it. >> -Michael >>> On 2 Mar 2024, at 11:09, Jonatan Schlag wro= te: >>> This only a cosmetic change but should making the code easier changeable >>> later on. >>> Signed-off-by: Jonatan Schlag >>> --- >>> src/initscripts/system/network | 12 +++++++----- >>> 1 file changed, 7 insertions(+), 5 deletions(-) >>> diff --git a/src/initscripts/system/network b/src/initscripts/system/netw= ork >>> index 0dcce060f..f334561de 100644 >>> --- a/src/initscripts/system/network >>> +++ b/src/initscripts/system/network >>> @@ -21,6 +21,8 @@ >>> . /etc/sysconfig/rc >>> . ${rc_functions} >>> +. /etc/init.d/networking/functions.network >>> + >>> eval $(/usr/local/bin/readhash /var/ipfire/ethernet/settings) >>> DO=3D"${1}" >>> @@ -54,11 +56,11 @@ case "${DO}" in >>> [ "$green" =3D=3D "1" ] && /etc/rc.d/init.d/networking/green start >>> # 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 >>> # 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 >>> # RED >>> @@ -84,16 +86,16 @@ case "${DO}" in >>> [ "$green" =3D=3D "1" ] && /etc/rc.d/init.d/networking/green stop >>> # 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 >>> # 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 >>> # 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 >>> -- >>> 2.39.2 --===============2225870361110553844==--