[RFC,03/15] Use bash as shebang in network initscripts

Message ID 20230523172314.7826-4-jonatan.schlag@ipfire.org
State Changes Requested
Headers
Series [RFC,01/15] Remove ipsec interface creation from network startup |

Commit Message

Jonatan Schlag May 23, 2023, 5:23 p.m. UTC
  /bin/sh is a symlink to /bin/bash on ipfire systems. Using /bin/sh in
the scripts as shebang hurts in two ways:

1. We use features which do not work with sh as shell. This is not
   really a problem but if we rely on features of a real bash we can
   state this clearly.
2. The syntay highlighting in vim does not work without a correct
   shebang. As I want and need correct syntax highlighting I propose to
   change the shebang.

Signed-off-by: Jonatan Schlag <jonatan.schlag@ipfire.org>
---
 src/initscripts/networking/any                      | 2 +-
 src/initscripts/networking/functions.network        | 2 +-
 src/initscripts/networking/red                      | 2 +-
 src/initscripts/networking/red.up/99-pakfire-update | 2 +-
 src/initscripts/system/network                      | 2 +-
 5 files changed, 5 insertions(+), 5 deletions(-)
  

Comments

Michael Tremer May 24, 2023, 8:59 a.m. UTC | #1
This should actually not change any behaviour of bash, but it does not break anything either.

> On 23 May 2023, at 18:23, Jonatan Schlag <jonatan.schlag@ipfire.org> wrote:
> 
> /bin/sh is a symlink to /bin/bash on ipfire systems. Using /bin/sh in
> the scripts as shebang hurts in two ways:
> 
> 1. We use features which do not work with sh as shell. This is not
>   really a problem but if we rely on features of a real bash we can
>   state this clearly.
> 2. The syntay highlighting in vim does not work without a correct
>   shebang. As I want and need correct syntax highlighting I propose to
>   change the shebang.
> 
> Signed-off-by: Jonatan Schlag <jonatan.schlag@ipfire.org>
> ---
> src/initscripts/networking/any                      | 2 +-
> src/initscripts/networking/functions.network        | 2 +-
> src/initscripts/networking/red                      | 2 +-
> src/initscripts/networking/red.up/99-pakfire-update | 2 +-
> src/initscripts/system/network                      | 2 +-
> 5 files changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/src/initscripts/networking/any b/src/initscripts/networking/any
> index 15197badb..dc4796e91 100644
> --- a/src/initscripts/networking/any
> +++ b/src/initscripts/networking/any
> @@ -1,4 +1,4 @@
> -#!/bin/sh
> +#!/bin/bash
> ###############################################################################
> #                                                                             #
> # IPFire.org - A linux based firewall                                         #
> diff --git a/src/initscripts/networking/functions.network b/src/initscripts/networking/functions.network
> index 0e2e5009e..4c7ad51d4 100644
> --- a/src/initscripts/networking/functions.network
> +++ b/src/initscripts/networking/functions.network
> @@ -1,4 +1,4 @@
> -#!/bin/sh
> +#!/bin/bash
> ###############################################################################
> #                                                                             #
> # IPFire.org - A linux based firewall                                         #
> diff --git a/src/initscripts/networking/red b/src/initscripts/networking/red
> index 16d48f3ac..8e41314b6 100644
> --- a/src/initscripts/networking/red
> +++ b/src/initscripts/networking/red
> @@ -1,4 +1,4 @@
> -#!/bin/sh
> +#!/bin/bash
> ###############################################################################
> #                                                                             #
> # IPFire.org - A linux based firewall                                         #
> diff --git a/src/initscripts/networking/red.up/99-pakfire-update b/src/initscripts/networking/red.up/99-pakfire-update
> index 3cc79a107..56cee66aa 100644
> --- a/src/initscripts/networking/red.up/99-pakfire-update
> +++ b/src/initscripts/networking/red.up/99-pakfire-update
> @@ -1,4 +1,4 @@
> -#!/bin/sh
> +#!/bin/bash
> 
> nice -n 10 /opt/pakfire/pakfire update >/dev/null 2>&1 &
> 
> diff --git a/src/initscripts/system/network b/src/initscripts/system/network
> index 7e457edfa..0d63b4e8b 100644
> --- a/src/initscripts/system/network
> +++ b/src/initscripts/system/network
> @@ -1,4 +1,4 @@
> -#!/bin/sh
> +#!/bin/bash
> ###############################################################################
> #                                                                             #
> # IPFire.org - A linux based firewall                                         #
> -- 
> 2.30.2
>
  

Patch

diff --git a/src/initscripts/networking/any b/src/initscripts/networking/any
index 15197badb..dc4796e91 100644
--- a/src/initscripts/networking/any
+++ b/src/initscripts/networking/any
@@ -1,4 +1,4 @@ 
-#!/bin/sh
+#!/bin/bash
 ###############################################################################
 #                                                                             #
 # IPFire.org - A linux based firewall                                         #
diff --git a/src/initscripts/networking/functions.network b/src/initscripts/networking/functions.network
index 0e2e5009e..4c7ad51d4 100644
--- a/src/initscripts/networking/functions.network
+++ b/src/initscripts/networking/functions.network
@@ -1,4 +1,4 @@ 
-#!/bin/sh
+#!/bin/bash
 ###############################################################################
 #                                                                             #
 # IPFire.org - A linux based firewall                                         #
diff --git a/src/initscripts/networking/red b/src/initscripts/networking/red
index 16d48f3ac..8e41314b6 100644
--- a/src/initscripts/networking/red
+++ b/src/initscripts/networking/red
@@ -1,4 +1,4 @@ 
-#!/bin/sh
+#!/bin/bash
 ###############################################################################
 #                                                                             #
 # IPFire.org - A linux based firewall                                         #
diff --git a/src/initscripts/networking/red.up/99-pakfire-update b/src/initscripts/networking/red.up/99-pakfire-update
index 3cc79a107..56cee66aa 100644
--- a/src/initscripts/networking/red.up/99-pakfire-update
+++ b/src/initscripts/networking/red.up/99-pakfire-update
@@ -1,4 +1,4 @@ 
-#!/bin/sh
+#!/bin/bash
 
 nice -n 10 /opt/pakfire/pakfire update >/dev/null 2>&1 &
 
diff --git a/src/initscripts/system/network b/src/initscripts/system/network
index 7e457edfa..0d63b4e8b 100644
--- a/src/initscripts/system/network
+++ b/src/initscripts/system/network
@@ -1,4 +1,4 @@ 
-#!/bin/sh
+#!/bin/bash
 ###############################################################################
 #                                                                             #
 # IPFire.org - A linux based firewall                                         #