From cbc91a500f82ce137e4d21ede180a18e12ccdc7e Mon Sep 17 00:00:00 2001 From: Joachim Desroches Date: Fri, 7 May 2021 17:54:10 +0200 Subject: [PATCH] __bird_static: update to use `channel` param instead of `ipv4` switch. --- type/__bird_static/files/template.sh | 7 +------ type/__bird_static/man.rst | 10 +++++----- type/__bird_static/parameter/boolean | 1 - type/__bird_static/parameter/required | 1 + 4 files changed, 7 insertions(+), 12 deletions(-) delete mode 100644 type/__bird_static/parameter/boolean create mode 100644 type/__bird_static/parameter/required diff --git a/type/__bird_static/files/template.sh b/type/__bird_static/files/template.sh index 05b5215..e95fa55 100755 --- a/type/__bird_static/files/template.sh +++ b/type/__bird_static/files/template.sh @@ -13,12 +13,7 @@ printf "protocol static %s {\n" "${__object_id:?}" [ -n "${description?}" ] && printf "\tdescription \"%s\";\n" "${description:?}" # Channel choice -if [ -f "${__object:?}/parameter/ipv4" ]; -then - printf "\tipv4;\n" -else - printf "\tipv6;\n" -fi +printf "%s;\n" "$(cat "${__object:?}/parameter/channel")" # Routes while read -r route diff --git a/type/__bird_static/man.rst b/type/__bird_static/man.rst index f42474a..808f44a 100644 --- a/type/__bird_static/man.rst +++ b/type/__bird_static/man.rst @@ -16,6 +16,11 @@ used unless the `ipv4` flag is passed. This type **expects** to depend on the `cdist-type__bird_core(7)` type. +REQUIRED PARAMETERS +------------------- +channel + The channel to use between the protocol and the table. + REQUIRED MULTIPLE PARAMETERS ---------------------------- route @@ -28,11 +33,6 @@ OPTIONAL PARAMETERS description An instance desciption to be printed when `birdc show protocols` is called. -BOOLEAN PARAMETERS ------------------- -ipv4 - Use the ipv4 channel instead of the default ipv6 one. - EXAMPLES -------- diff --git a/type/__bird_static/parameter/boolean b/type/__bird_static/parameter/boolean deleted file mode 100644 index 53bb6dd..0000000 --- a/type/__bird_static/parameter/boolean +++ /dev/null @@ -1 +0,0 @@ -ipv4 diff --git a/type/__bird_static/parameter/required b/type/__bird_static/parameter/required new file mode 100644 index 0000000..6dca835 --- /dev/null +++ b/type/__bird_static/parameter/required @@ -0,0 +1 @@ +channel