public inbox for development@lists.ipfire.org
 help / color / mirror / Atom feed
From: Jonatan Schlag <jonatan.schlag@ipfire.org>
To: development@lists.ipfire.org
Subject: Re: [PATCH 3/5] network initscript: Use network_zone_exists
Date: Sat, 16 Mar 2024 10:46:30 +0100	[thread overview]
Message-ID: <0aaffd5600877f2f1a58a95855358872@ipfire.org> (raw)
In-Reply-To: <D90F27A4-42F6-4FA9-94E5-973B44036D6A@ipfire.org>

[-- Attachment #1: Type: text/plain, Size: 2573 bytes --]


Hi,

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 wrong.

Jonatan


Am 2024-03-11 18:02, schrieb Michael Tremer:
> 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 <jonatan.schlag(a)ipfire.org> 
>> wrote:
>> 
>> This only a cosmetic change but should making the code easier 
>> changeable
>> later on.
>> 
>> Signed-off-by: Jonatan Schlag <jonatan.schlag(a)ipfire.org>
>> ---
>> src/initscripts/system/network | 12 +++++++-----
>> 1 file changed, 7 insertions(+), 5 deletions(-)
>> 
>> 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 @@
>> 
>> . /etc/sysconfig/rc
>> . ${rc_functions}
>> +. /etc/init.d/networking/functions.network
>> +
>> eval $(/usr/local/bin/readhash /var/ipfire/ethernet/settings)
>> 
>> DO="${1}"
>> @@ -54,11 +56,11 @@ case "${DO}" in
>> [ "$green" == "1" ] && /etc/rc.d/init.d/networking/green start
>> 
>> # BLUE
>> - [ "$blue" == "1" ] && [ "$CONFIG_TYPE" = "3" -o "$CONFIG_TYPE" = "4" 
>> ] && \
>> + [ "$blue" == "1" ] && network_zone_exists "blue" && \
>> /etc/rc.d/init.d/networking/blue start
>> 
>> # ORANGE
>> - [ "$orange" == "1" ] && [ "$CONFIG_TYPE" = "2" -o "$CONFIG_TYPE" = 
>> "4" ] && \
>> + [ "$orange" == "1" ] && network_zone_exists "orange" && \
>> /etc/rc.d/init.d/networking/orange start
>> 
>> # RED
>> @@ -84,16 +86,16 @@ case "${DO}" in
>> [ "$green" == "1" ] && /etc/rc.d/init.d/networking/green stop
>> 
>> # BLUE
>> - [ "$blue" == "1" ] && [ "$CONFIG_TYPE" = "3" -o "$CONFIG_TYPE" = "4" 
>> ] && \
>> + [ "$blue" == "1" ] && network_zone_exists "blue" && \
>> /etc/rc.d/init.d/networking/blue stop
>> 
>> # ORANGE
>> - [ "$orange" == "1" ] && [ "$CONFIG_TYPE" = "2" -o "$CONFIG_TYPE" = 
>> "4" ] && \
>> + [ "$orange" == "1" ] && network_zone_exists "orange" && \
>> /etc/rc.d/init.d/networking/orange stop
>> 
>> # RED
>> if [ "$red" == "1" ]; then
>> - if [ "$CONFIG_TYPE" = "1" -o "$CONFIG_TYPE" = "2" -o "$CONFIG_TYPE" 
>> = "3" -o "$CONFIG_TYPE" = "4" ]; then
>> + if network_zone_exists "red"; then
>> /etc/rc.d/init.d/networking/red stop
>> fi
>> fi
>> --
>> 2.39.2
>> 

  reply	other threads:[~2024-03-16  9:46 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-02 11:09 [PATCH 1/5] functions.network: Add proper Exit Codes Jonatan Schlag
2024-03-02 11:09 ` [PATCH 2/5] functions.network: Add network_zone_exists Jonatan Schlag
2024-03-08 11:14   ` Jonatan Schlag
2024-03-12 10:32     ` Michael Tremer
2024-03-16  9:35       ` Jonatan Schlag
2024-03-18 16:27         ` Michael Tremer
2024-03-25  7:46           ` Jonatan Schlag
2024-03-25 10:55             ` Michael Tremer
2024-03-12  9:59   ` Michael Tremer
2024-03-16  9:43     ` Jonatan Schlag
2024-03-18 16:32       ` Michael Tremer
2024-03-25  7:55         ` Jonatan Schlag
2024-03-25 11:01           ` Michael Tremer
2024-03-02 11:09 ` [PATCH 3/5] network initscript: Use network_zone_exists Jonatan Schlag
2024-03-11 17:02   ` Michael Tremer
2024-03-16  9:46     ` Jonatan Schlag [this message]
2024-03-16 11:25       ` Michael Tremer
2024-03-02 11:09 ` [PATCH 4/5] network initscript: Avoid an infinite loop Jonatan Schlag
2024-03-02 11:09 ` [PATCH 5/5] network initscript: drop unused variable Jonatan Schlag

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0aaffd5600877f2f1a58a95855358872@ipfire.org \
    --to=jonatan.schlag@ipfire.org \
    --cc=development@lists.ipfire.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox