feb 01 00:56:21 frozen microsample.microsample[286081]: Error: Invalid value for '--port' / '-p': '$(snapctl get port)' is not a valid integer.
feb 01 00:56:21 frozen systemd[1]: snap.microsample.microsample.service: Main process exited, code=exited, status=2/INVALIDARGUMENT
What can I do to dynamically change the command to use the value for the port in the snap?
environment variables do not allow scripts, they are not processed by a shell but just exported into the environment, what Jon said is correct, you should use a wrapper script for such a case …
… also, when I do as recommended - I get this error when I install the snap:
feb 01 14:27:01 frozen microsample.microsample[37167]: /snap/microsample/x1/bin/flask-wrapper: 5: exec: /bin/flask: not found
feb 01 14:27:01 frozen systemd[1]: snap.microsample.microsample.service: Main process exited, code=exited, status=127/n/a