This fixes a bug where template presets with a specified instance were
not being handled. The install script previously parsed the entire line,
including the instance(s) and ran 'systemctl preset' on it all, e.g.
'systemctl preset unudhcpd@.service usb0'.
The script will now:
- detect lines that contain a template + instance(s)
- diff the instances
- run preset on template@instance for all added or removed instances
Template presets that don't have any instances specified in the preset
file (because they have a DefaultInstance= set) are treated just like
any other unit since we can run preset on those and it enables the
template with the default instance.
Signed-off-by: Clayton Craft <craftyguy@postmarketos.org>
Part-of: <https://gitlab.postmarketos.org/postmarketOS/pmaports/-/merge_requests/9026>