[PATCH] configurenetwork: Tidy-up auto configuration functions

Christian Dresel fff at chrisi01.de
So Feb 10 17:15:18 CET 2019


hi

Reviewed-by: Christian Dresel <fff at chrisi01.de>

Gruß

Christian

On 04.02.19 14:05, Adrian Schmutzler wrote:
> This fixes a typo in description and introduces a single variable
> for the sysctlfile.
>
> Signed-off-by: Adrian Schmutzler <freifunk at adrianschmutzler.de>
> ---
>  .../fff/fff-network/files/usr/sbin/configurenetwork   | 19 ++++++++++---------
>  1 file changed, 10 insertions(+), 9 deletions(-)
>
> diff --git a/src/packages/fff/fff-network/files/usr/sbin/configurenetwork b/src/packages/fff/fff-network/files/usr/sbin/configurenetwork
> index 0e038a49..448bd04b 100755
> --- a/src/packages/fff/fff-network/files/usr/sbin/configurenetwork
> +++ b/src/packages/fff/fff-network/files/usr/sbin/configurenetwork
> @@ -30,19 +30,20 @@ setupPorts() {
>  
>  setAutoConf() {
>      # Sets ipv6 auto configuration on an interface to on/off
> -    # Usage: enableAutoConf <interface> <[0|1]>
> +    # Usage: setAutoConf <interface> <[0|1]>
>      local iface=$1
>      local on=$2
>  
> -    echo "# Generated from configurenetwork" > "/etc/sysctl.d/51-fff-network-$iface.conf"
> -    echo "net.ipv6.conf.$iface.accept_ra = $on" >> "/etc/sysctl.d/51-fff-network-$iface.conf"
> -    echo "net.ipv6.conf.$iface.accept_ra_defrtr = $on" >> "/etc/sysctl.d/51-fff-network-$iface.conf"
> -    echo "net.ipv6.conf.$iface.accept_ra_pinfo = $on" >> "/etc/sysctl.d/51-fff-network-$iface.conf"
> -    echo "net.ipv6.conf.$iface.autoconf = $on" >> "/etc/sysctl.d/51-fff-network-$iface.conf"
> -    echo "net.ipv6.conf.$iface.accept_ra_rtr_pref = $on" >> "/etc/sysctl.d/51-fff-network-$iface.conf"
> -    echo "net.ipv6.conf.$iface.forwarding = 0" >> "/etc/sysctl.d/51-fff-network-$iface.conf"
> +    sysctlfile="/etc/sysctl.d/51-fff-network-$iface.conf"
> +    echo "# Generated from configurenetwork" > "$sysctlfile"
> +    echo "net.ipv6.conf.$iface.accept_ra = $on" >> "$sysctlfile"
> +    echo "net.ipv6.conf.$iface.accept_ra_defrtr = $on" >> "$sysctlfile"
> +    echo "net.ipv6.conf.$iface.accept_ra_pinfo = $on" >> "$sysctlfile"
> +    echo "net.ipv6.conf.$iface.autoconf = $on" >> "$sysctlfile"
> +    echo "net.ipv6.conf.$iface.accept_ra_rtr_pref = $on" >> "$sysctlfile"
> +    echo "net.ipv6.conf.$iface.forwarding = 0" >> "$sysctlfile"
>  
> -    /sbin/sysctl -p "/etc/sysctl.d/51-fff-network-$iface.conf"
> +    /sbin/sysctl -p "$sysctlfile"
>  }
>  
>  enableAutoConf() {


Mehr Informationen über die Mailingliste franken-dev