I know something like this works:
" if [ ${SOMETHING} -eq 1 ]; then do this; fi"
I just can't figure out how to get it formatted for multiple lines so it
looks nice/more readable.
On Monday, August 5, 2019 at 12:08:07 PM UTC-5, Benjamin Lu wrote:
>
> I don't think you can, the best way to use scripts on its own file and you
> can do if statements.
>
> "scripts": [
> "scripts/setup.sh",
> "scripts/update.sh",
> "scripts/packages.sh"
> ],
>
>
> On Monday, August 5, 2019 at 10:01:29 AM UTC-7, Vritual Packer wrote:
>
>> Spent quite a while googling this and can't find an example...
>>
>> What is the proper way to do a if then statement inside of an inline
>> shell?
>>
>> example:
>> "type": "shell",
>> "inline" : [
>> "yum update -y"
>> " if [ $VAR -eq "something" ]; then
>> do this
>> and this
>> and finally this
>> else
>> do something else
>> fi",
>>
>> Thank you for any help...
>>
>>
>>
--
This mailing list is governed under the HashiCorp Community Guidelines -
https://www.hashicorp.com/community-guidelines.html. Behavior in violation of
those guidelines may result in your removal from this mailing list.
GitHub Issues: https://github.com/mitchellh/packer/issues
IRC: #packer-tool on Freenode
---
You received this message because you are subscribed to the Google Groups
"Packer" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/packer-tool/ff3acf8d-2d6e-4e09-835f-e3ae3d54dad8%40googlegroups.com.