Something went wrong. Try again.
JavaScript generic ASN.1 parser (mirror)
Something went wrong. Try again.
asn1js updateRFC.sh
1.1 kB · 32 lines
Shell
at github-101
123456789101112131415161718192021222324252627282930313233#/bin/shRFCs="5280 5208 3369 3161 2986 4211 4210 8017 4511"downloadRFC() { URL="https://www.ietf.org/rfc/rfc$1.txt" if [ -x /usr/bin/fetch ]; then /usr/bin/fetch -m --no-verify-peer $URL elif [ -x /usr/bin/wget ]; then /usr/bin/wget -N --no-check-certificate $URL elif [ ! -r dumpasn1.cfg ]; then echo Please download $URL in this directory. exit 1 fi}echo '{}' > rfcdef.json # start from scratchmkdir -p rfccd rfcfor n in $RFCs; do downloadRFC $n ../parseRFC.js rfc$n.txt ../rfcdef.jsondonecd ..{ echo "// content parsed from ASN.1 definitions as found in the following RFCs: $RFCs" echo "// Copyright (C) The IETF Trust (2008)" echo "// as far as I can tell this file is allowed under the following clause:" echo "// It is acceptable under the current IETF rules (RFC 5378) to modify extracted code if necessary." echo "// https://trustee.ietf.org/about/faq/#reproducing-rfcs" echo -n "export const rfcdef = " cat rfcdef.json echo ";"} > rfcdef.jsecho Conversion completed.