summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorosm0sis <osm0sis@outlook.com>2017-09-22 01:35:51 -0300
committerosm0sis <osm0sis@outlook.com>2017-09-22 01:35:51 -0300
commitaa1377c9abc6f991a28c4e54e87adc55d84c9aa7 (patch)
tree0ee0ac06486ae398e2b25f6e98860084835749e9 /tools
parent65019b0f492634d8b140f9d2da478752d829137c (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-xtools/ak2-core.sh3
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;
}