File: check-run-create.sh

package info (click to toggle)
ipv6calc 0.93.1-2
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 3,020 kB
  • sloc: ansic: 36,079; perl: 2,175; sh: 1,322; makefile: 557; xml: 424
file content (31 lines) | stat: -rwxr-xr-x 1,371 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/bin/sh
#
# Project    : ipv6calc/databases/ipv6-assignment
# File       : check-run-create.sh
# Version    : $Id: check-run-create.sh,v 1.4 2012/02/05 09:33:55 peter Exp $
# Copyright  : 2005-2012 by Peter Bieringer <pb (at) bieringer.de>

flag_update=0

if [ -f dbipv6addr_assignment.h ]; then
	IANA=`find    ../registries/iana    -type f -name 'ipv6-unicast-address-assignments' -newer dbipv6addr_assignment.h | wc -l`
	ARIN=`find    ../registries/arin    -type f -name 'delegated-arin*'    -newer dbipv6addr_assignment.h | wc -l`
	APNIC=`find   ../registries/apnic   -type f -name 'delegated-apnic*'   -newer dbipv6addr_assignment.h | wc -l`
	RIPENCC=`find ../registries/ripencc -type f -name 'delegated-ripencc*' -newer dbipv6addr_assignment.h | wc -l`
	LACNIC=`find  ../registries/lacnic  -type f -name 'delegated-lacnic*'  -newer dbipv6addr_assignment.h | wc -l`
	AFRINIC=`find ../registries/afrinic -type f -name 'delegated-afrinic*' -newer dbipv6addr_assignment.h | wc -l`

	echo "Found newer than dbipv6addr_assignment.h files: IANA=$IANA ARIN=$ARIN APNIC=$APNIC RIPENCC=$RIPENCC LACNIC=$LACNIC AFRINIC=$AFRINIC"

	if [ $IANA -gt 0 -o $ARIN -gt 0 -o $APNIC -gt 0 -o $RIPENCC -gt 0 -o $LACNIC -gt 0 -o $AFRINIC -gt 0 ]; then
		flag_update=1
	fi
else
	flag_update=1
fi

if [ $flag_update -eq 1 ]; then
	./create-registry-list.pl
else
	echo " Nothing to do!"
fi