fff-hoods: Allow correct ula_prefix syntax in hoodfiles #90
|
@ -1,7 +1,7 @@
|
|||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=fff-hoods
|
||||
PKG_RELEASE:=18
|
||||
PKG_RELEASE:=19
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
|
|
|
@ -191,8 +191,15 @@ if [ -s "$hoodfiletmp" ]; then
|
|||
if [ -n "$prefix" ] ; then
|
||||
# remove escape character
|
||||
prefix=$(echo "$prefix" | sed -e 's,\\,,')
|
||||
# create proper prefix
|
||||
prefix=$(echo "$prefix" | sed -e 's,/,:/,')
|
||||
|
||||
# In earlier firmware versions the prefix had to be written
|
||||
# in an incorrect syntax (missing a trailing colon).
|
||||
# To make hoodfiles with this old incorrect syntax work with
|
||||
# newer firmware versions like this one, we have to fix the
|
||||
# incorrect syntax here. Both the old, incorrect and
|
||||
# the correct syntax work with this fix.
|
||||
prefix="$(echo "$prefix" | sed -e 's,\([^:]\):/,\1::/,')"
|
||||
|
||||
|
||||
mac=$(cat "/sys/class/net/br-client/address")
|
||||
addr=$(owipcalc "$prefix" add "::$(ipMacSuffix "$mac")")
|
||||
addr_eui=$(owipcalc "$prefix" add "::$(ipEUISuffix "$mac")")
|
||||
|
|
Loading…
Reference in New Issue
Block a user
Der forward-slash muss nicht escaped werden (es funktioniert offenbar mit und ohne backslash zum escapen). Da nicht notwendig würde ich aber die Variante ohne Backslash vorziehen:
prefix=$(echo "$prefix" | sed -e 's,\([^:]\):/,\1::/,')
Die äußeren Anführungszeichen können ebenfalls entfallen, die Funktion gibt es bei a=$() für umsonst.
Mit dem entfernten Backslash
Reviewed-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>