Support running on CoreOS

CoreOS has not perl and envsubst command.
modified to use an alternative command to work with CoreOS.