diff options
author | osm0sis <osm0sis@outlook.com> | 2017-09-22 01:35:51 -0300 |
---|---|---|
committer | osm0sis <osm0sis@outlook.com> | 2017-09-22 01:35:51 -0300 |
commit | aa1377c9abc6f991a28c4e54e87adc55d84c9aa7 (patch) | |
tree | 0ee0ac06486ae398e2b25f6e98860084835749e9 /tools | |
parent | 65019b0f492634d8b140f9d2da478752d829137c (diff) |
AK2: fix patch_fstab substring replacement
- the 'original string' ($5) was not being used, instead the entire part was always being replaced with the 'replacement string' ($6)
- replace the target 'original string' of the entry part with 'replacement string' as expected/intended
NOTE: any properly written patch_fstab commands with original string as the complete original part WILL remain working as this is a backwards compatible change
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/ak2-core.sh | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/ak2-core.sh b/tools/ak2-core.sh index 6114232..55abb1c 100755 --- a/tools/ak2-core.sh +++ b/tools/ak2-core.sh @@ -364,7 +364,8 @@ patch_fstab() { options) part=$(echo "$entry" | awk '{ print $4 }');; flags) part=$(echo "$entry" | awk '{ print $5 }');; esac; - newentry=$(echo "$entry" | sed "s;${part};${6};"); + newpart=$(echo "$part" | sed "s;${5};${6};"); + newentry=$(echo "$entry" | sed "s;${part};${newpart};"); sed -i "s;${entry};${newentry};" $1; fi; } |