netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: netdev@vger.kernel.org
Cc: Stephen Hemminger <stephen@networkplumber.org>
Subject: [PATCH iproute2 2/3] examples: remove gaiconf
Date: Wed, 23 Oct 2019 09:16:31 -0700	[thread overview]
Message-ID: <20191023161632.541-3-stephen@networkplumber.org> (raw)
In-Reply-To: <20191023161632.541-1-stephen@networkplumber.org>

The gaiconf script is a workaround for something now handled
in distros as part of libc.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 examples/gaiconf | 134 -----------------------------------------------
 1 file changed, 134 deletions(-)
 delete mode 100644 examples/gaiconf

diff --git a/examples/gaiconf b/examples/gaiconf
deleted file mode 100644
index d75292b900cc..000000000000
--- a/examples/gaiconf
+++ /dev/null
@@ -1,134 +0,0 @@
-#!/bin/sh
-
-#
-# Setup address label from /etc/gai.conf
-#
-# Written by YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>, 2010.
-#
-
-IP=ip
-DEFAULT_GAICONF=/etc/gai.conf
-verbose=
-debug=
-
-function run ()
-{
-	if [ x"$verbose" != x"" ]; then
-		echo "$@"
-	fi
-	if [ x"$debug" = x"" ]; then
-		"$@"
-	fi
-}
-
-function do_load_config ()
-{
-	file=$1; shift
-	flush=1
-	cat $file | while read command prefix label; do
-		if [ x"$command" = x"#label" ]; then
-			if [ ${flush} = 1 ]; then
-				run ${IP} -6 addrlabel flush
-				flush=0
-			fi
-			run ${IP} -6 addrlabel add prefix $prefix label $label
-		fi
-	done
-}
-
-function do_list_config ()
-{
-	${IP} -6 addrlabel list | while read p pfx l lbl; do
-		echo label ${pfx} ${lbl}
-	done
-}
-
-function help ()
-{
-	echo "Usage: $0 [-v] {--list | --config [ ${DEFAULT_GAICONF} ] | --default}"
-	exit 1
-}
-
-TEMP=`getopt -o c::dlv -l config::,default,list,verbose -n gaiconf -- "$@"`
-
-if [ $? != 0 ]; then
-	echo "Terminating..." >&2
-	exit 1
-fi
-
-TEMPFILE=`mktemp`
-
-eval set -- "$TEMP"
-
-while true ; do
-	case "$1" in
-		-c|--config)
-			if [ x"$cmd" != x"" ]; then
-				help
-			fi
-			case "$2" in
-			"")	gai_conf="${DEFAULT_GAICONF}"
-				shift 2
-				;;
-			*)	gai_conf="$2"
-				shift 2
-			esac
-			cmd=config
-			;;
-		-d|--default)
-			if [ x"$cmd" != x"" ]; then
-				help
-			fi
-			gai_conf=${TEMPFILE}
-			cmd=config
-			;;
-		-l|--list)
-			if [ x"$cmd" != x"" ]; then
-				help
-			fi
-			cmd=list
-			shift
-			;;
-		-v)
-			verbose=1
-			shift
-			;;
-		--)
-			shift;
-			break
-			;;
-		*)
-			echo "Internal error!" >&2
-			exit 1
-			;;
-	esac
-done
-
-case "$cmd" in
-	config)
-		if [ x"$gai_conf" = x"${TEMPFILE}" ]; then
-			sed -e 's/^[[:space:]]*//' <<END_OF_DEFAULT >${TEMPFILE}
-				label ::1/128       0
-				label ::/0          1
-				label 2002::/16     2
-				label ::/96         3
-				label ::ffff:0:0/96 4
-				label fec0::/10     5
-				label fc00::/7      6
-				label 2001:0::/32   7
-END_OF_DEFAULT
-		fi
-		do_load_config "$gai_conf"
-		;;
-	list)
-		do_list_config
-		;;
-	*)
-		help
-		;;
-esac
-
-rm -f "${TEMPFILE}"
-
-exit 0
-
-- 
2.20.1


  parent reply	other threads:[~2019-10-23 16:16 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-23 16:16 [PATCH iproute2 0/3] remove old examples Stephen Hemminger
2019-10-23 16:16 ` [PATCH iproute2 1/3] examples: remove out of date cbq stuff Stephen Hemminger
2019-10-23 16:16 ` Stephen Hemminger [this message]
2019-10-23 16:16 ` [PATCH iproute2 3/3] examples: remove diffserv Stephen Hemminger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191023161632.541-3-stephen@networkplumber.org \
    --to=stephen@networkplumber.org \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).