From ef1952b6d89f2326c56932bfc07e19ff7f713a01 Mon Sep 17 00:00:00 2001 From: Yuya Kusakabe Date: Sat, 22 Jul 2017 22:31:25 +0900 Subject: Run script with vyattacfg group --- spec/bgp4/config.yaml | 12 ++++++------ spec/bgp4/vyos1_script.sh | 4 ++++ spec/bgp4/vyos2_script.sh | 4 ++++ spec/bgp4/vyos3_script.sh | 4 ++++ spec/bgp4/vyos4_script.sh | 4 ++++ 5 files changed, 22 insertions(+), 6 deletions(-) (limited to 'spec/bgp4') diff --git a/spec/bgp4/config.yaml b/spec/bgp4/config.yaml index 01178dc..35406da 100644 --- a/spec/bgp4/config.yaml +++ b/spec/bgp4/config.yaml @@ -1,15 +1,15 @@ --- vyos1: :networks: - net1: "10.0.1.11" - net2: "10.0.2.11" + net1: "10.0.1.11/24" + net2: "10.0.2.11/24" vyos2: :networks: - net1: "10.0.1.12" - net3: "10.0.3.11" + net1: "10.0.1.12/24" + net3: "10.0.3.11/24" vyos3: :networks: - net2: "10.0.2.13" + net2: "10.0.2.13/24" vyos4: :networks: - net3: "10.0.3.14" + net3: "10.0.3.14/24" diff --git a/spec/bgp4/vyos1_script.sh b/spec/bgp4/vyos1_script.sh index 3adbc0f..3767236 100644 --- a/spec/bgp4/vyos1_script.sh +++ b/spec/bgp4/vyos1_script.sh @@ -1,5 +1,9 @@ #!/bin/vbash +if [ "$(id -g -n)" != 'vyattacfg' ] ; then + exec sg vyattacfg -c "/bin/vbash $(readlink -f $0) $@" +fi + source /opt/vyatta/etc/functions/script-template set protocols bgp 65536 neighbor 10.0.1.12 ebgp-multihop 2 diff --git a/spec/bgp4/vyos2_script.sh b/spec/bgp4/vyos2_script.sh index 1be2c7e..7cb0586 100644 --- a/spec/bgp4/vyos2_script.sh +++ b/spec/bgp4/vyos2_script.sh @@ -1,5 +1,9 @@ #!/bin/vbash +if [ "$(id -g -n)" != 'vyattacfg' ] ; then + exec sg vyattacfg -c "/bin/vbash $(readlink -f $0) $@" +fi + source /opt/vyatta/etc/functions/script-template set protocols bgp 65537 neighbor 10.0.1.11 ebgp-multihop 2 diff --git a/spec/bgp4/vyos3_script.sh b/spec/bgp4/vyos3_script.sh index e443225..3db2539 100644 --- a/spec/bgp4/vyos3_script.sh +++ b/spec/bgp4/vyos3_script.sh @@ -1,5 +1,9 @@ #!/bin/vbash +if [ "$(id -g -n)" != 'vyattacfg' ] ; then + exec sg vyattacfg -c "/bin/vbash $(readlink -f $0) $@" +fi + source /opt/vyatta/etc/functions/script-template set protocols static route 10.0.3.0/24 next-hop 10.0.2.11 diff --git a/spec/bgp4/vyos4_script.sh b/spec/bgp4/vyos4_script.sh index ec45e72..df048bb 100644 --- a/spec/bgp4/vyos4_script.sh +++ b/spec/bgp4/vyos4_script.sh @@ -1,5 +1,9 @@ #!/bin/vbash +if [ "$(id -g -n)" != 'vyattacfg' ] ; then + exec sg vyattacfg -c "/bin/vbash $(readlink -f $0) $@" +fi + source /opt/vyatta/etc/functions/script-template set protocols static route 10.0.2.0/24 next-hop 10.0.3.11 -- cgit v1.2.3