commit 809d82956f4b3ae8c5f393efc2ef4692173685f5 Author: Harald Welte Date: Fri Dec 16 20:35:28 2016 +0100 initial import of scripts to mirror + sym-link 3GPP specs diff --git a/gen_links.sh b/gen_links.sh new file mode 100755 index 0000000..f638721 --- /dev/null +++ b/gen_links.sh @@ -0,0 +1,34 @@ +#!/bin/sh + +# a rather simple script to recover the 3GPP spec number (if any) from the +# title page of the ETSI TS PDF and then create a symlink in the format +# $SPEC-$VERSIO.pdf + +# Author: Harald Welte + +# source base directory containing the ETSI TS PDFs +SRCDIR=./www.etsi.org/deliver/etsi_ts + +# directory from where to create all the symlinks +LINKDIR=./by_chapter + +# ensure the symlink directory exists +[ -d $LINKDIR ] || mkdir $LINKDIR + +# get a list of all pdf files +PDFS=`find $SRCDIR -name "*.pdf"` + +for f in $PDFS; do + # check if it contains a line with suitable prefix + RES=`pdfgrep -m 1 '\(3GPP TS' $f` + if [ $? -eq 0 ]; then + # extract the filename with spec number + version name (e.g. 44.008-4.0.0.pdf) + LINK=`echo $RES | awk '/\(3GPP TS ([0-9]+\.[0-9]+) version (\w+)/ {printf "%s-%s.pdf", $3, $5}'` + if [ "x$LINK" != "x" ]; then + echo $LINK + # crate the actual symlink + ln -sf ../$f "$LINKDIR/$LINK" + fi + fi +done + diff --git a/mirror.sh b/mirror.sh new file mode 100755 index 0000000..62487c0 --- /dev/null +++ b/mirror.sh @@ -0,0 +1,6 @@ +#!/bin/sh + +# a rather simple script to recursively dowload all of the ETSI technical +# specifications in PDF format + +wget -c -r -np http://www.etsi.org/deliver/etsi_ts/