| # Setup address label from /etc/gai.conf |
| # Written by YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>, 2010. |
| DEFAULT_GAICONF=/etc/gai.conf |
| if [ x"$verbose" != x"" ]; then |
| if [ x"$debug" = x"" ]; then |
| function do_load_config () |
| cat $file | while read command prefix label; do |
| if [ x"$command" = x"#label" ]; then |
| if [ ${flush} = 1 ]; then |
| run ${IP} -6 addrlabel flush |
| run ${IP} -6 addrlabel add prefix $prefix label $label |
| function do_list_config () |
| ${IP} -6 addrlabel list | while read p pfx l lbl; do |
| echo "Usage: $0 [-v] {--list | --config [ ${DEFAULT_GAICONF} ] | --default}" |
| TEMP=`getopt -o c::dlv -l config::,default,list,verbose -n gaiconf -- "$@"` |
| echo "Terminating..." >&2 |
| if [ x"$cmd" != x"" ]; then |
| "") gai_conf="${DEFAULT_GAICONF}" |
| if [ x"$cmd" != x"" ]; then |
| if [ x"$cmd" != x"" ]; then |
| echo "Internal error!" >&2 |
| if [ x"$gai_conf" = x"${TEMPFILE}" ]; then |
| sed -e 's/^[[:space:]]*//' <<END_OF_DEFAULT >${TEMPFILE} |
| do_load_config "$gai_conf" |