Azure ARM template - Multi line bash script

Copper Contributor

Hi,

  Greetings!!!

 

I would like to include the following bash scripts as a startup script for a VM. I am creating the VM using ARM template. I would like to know the syntax to use to include this multiline bash script in ARM template. If it is one line script, it is working fine however having issue with multi line script.

 

script:

service=/etc/sysconfig/iptables

cat > $service << FW_EOF

*filter

:INPUT ACCEPT [196:15477]

:FORWARD ACCEPT [0:0]

:OUTPUT ACCEPT [84655:113694509]

COMMIT

FW_EOF

 

I have included it as follows in my ARM template.

 

script: "

service=/etc/sysconfig/iptables

cat > $service << FW_EOF

*filter

:INPUT ACCEPT [196:15477]

:FORWARD ACCEPT [0:0]

:OUTPUT ACCEPT [84655:113694509]

COMMIT

FW_EOF"

 

It is not working. Any help appreciated.

 

Thanks,
Santosh

 

0 Replies