[RFC,05/15] network initscripts: Remove code for old zone scheme
Commit Message
A long time ago (2007) there were more config types possible then 1, 2, 3
and 4. As our installer currently only accepts config type out of the set
1, 2, 3 and 4 we do not need to check if our CONFIG_TYPE is in this set.
Signed-off-by: Jonatan Schlag <jonatan.schlag@ipfire.org>
---
src/initscripts/system/network | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
Comments
I believe the intention here was to be more extensible for more zones. This obviously never happened.
So I am happy with dropping the check.
We might only be left with some confusing behaviour if CONFIG_TYPE isn’t set at all. But that should break the system anyways.
> On 23 May 2023, at 18:23, Jonatan Schlag <jonatan.schlag@ipfire.org> wrote:
>
> A long time ago (2007) there were more config types possible then 1, 2, 3
> and 4. As our installer currently only accepts config type out of the set
> 1, 2, 3 and 4 we do not need to check if our CONFIG_TYPE is in this set.
>
> Signed-off-by: Jonatan Schlag <jonatan.schlag@ipfire.org>
> ---
> src/initscripts/system/network | 8 +++-----
> 1 file changed, 3 insertions(+), 5 deletions(-)
>
> diff --git a/src/initscripts/system/network b/src/initscripts/system/network
> index fda16919d..146b3fda8 100644
> --- a/src/initscripts/system/network
> +++ b/src/initscripts/system/network
> @@ -61,11 +61,9 @@ case "${DO}" in
>
> # RED
> if [ "$red" == "1" ]; then
> - if [ "$CONFIG_TYPE" = "1" -o "$CONFIG_TYPE" = "2" -o "$CONFIG_TYPE" = "3" -o "$CONFIG_TYPE" = "4" ]; then
> - # Remove possible leftover files
> - rm -f /var/ipfire/red/{active,device,dial-on-demand,dns1,dns2,local-ipaddress,remote-ipaddress,resolv.conf}
> - [ "$AUTOCONNECT" == "off" ] || /etc/rc.d/init.d/networking/red start
> - fi
> + # Remove possible leftover files
> + rm -f /var/ipfire/red/{active,device,dial-on-demand,dns1,dns2,local-ipaddress,remote-ipaddress,resolv.conf}
> + [ "$AUTOCONNECT" == "off" ] || /etc/rc.d/init.d/networking/red start
> fi
>
> /etc/rc.d/init.d/static-routes start
> --
> 2.30.2
>
@@ -61,11 +61,9 @@ case "${DO}" in
# RED
if [ "$red" == "1" ]; then
- if [ "$CONFIG_TYPE" = "1" -o "$CONFIG_TYPE" = "2" -o "$CONFIG_TYPE" = "3" -o "$CONFIG_TYPE" = "4" ]; then
- # Remove possible leftover files
- rm -f /var/ipfire/red/{active,device,dial-on-demand,dns1,dns2,local-ipaddress,remote-ipaddress,resolv.conf}
- [ "$AUTOCONNECT" == "off" ] || /etc/rc.d/init.d/networking/red start
- fi
+ # Remove possible leftover files
+ rm -f /var/ipfire/red/{active,device,dial-on-demand,dns1,dns2,local-ipaddress,remote-ipaddress,resolv.conf}
+ [ "$AUTOCONNECT" == "off" ] || /etc/rc.d/init.d/networking/red start
fi
/etc/rc.d/init.d/static-routes start