Closed WillWritesCode closed 4 years ago
Thank you for the contribution and the tests!
I have to look closer and test a bit.
To make this work the user has to remove the comment signs in https://github.com/hypriot/image-builder-rpi/blob/master/builder/files/boot/user-data#L40-L59
Maybe we should mark this comment block a little different to easily do a sed_i
to uncomment the block.
We should be able to add something like ^[^#]
as the first term in sed_i like:
sed_i -e "/^#/s/.*ssid=.*\$/ ssid=\"${WIFI_SSID}\"/" "${boot}/user-data"
That way it leaves comments alone. Probably needs different tests files (one with the section commented, one not) + check it doesn’t affect the commented version.
I've just pushed some changes to prevent the sed_i for commented lines.
Probably not enough to close issue #109, but would cover my use-case
As you said @StefanScherer, an alternative marking of the wifi comment block might be an option to make a full implementation simpler, or just copy in the entire wifi section if no uncommented section is found...
added