From 9f4b5a172ee71d0accf30bfc5fcc5e217e0b181d Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Thu, 29 Sep 2022 15:56:39 +0200 Subject: [PATCH] add ripe.sh --- ripe.sh | 81 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100755 ripe.sh diff --git a/ripe.sh b/ripe.sh new file mode 100755 index 0000000..dfda77a --- /dev/null +++ b/ripe.sh @@ -0,0 +1,81 @@ +#!/bin/sh +# 2022-03-18, ungleich (foss at ungleich.ch) +# Copying: GPL3+ + +if [ $# -lt 2 ] ; then + echo "$0 network asn [nodryrun]" + echo "ASN needs to be in ASXXXXXX format" + echo "By default uses dry-run and does not create objects" + exit 1 +fi + +set -x + +network=$1; shift +asn=$1; shift + +if [ $# -ge 1 ]; then + dryrun="" +else + dryrun="&dry-run" +fi + +form=$(mktemp) + +case ${network} in + *:*) + obj_type=route6 + ;; + *.*) + obj_type=route + ;; + *) + echo "No idea what to do with $network" + exit 1 + ;; +esac + +cat > $form <