aboutsummaryrefslogtreecommitdiff
path: root/http-status-codes/extend.sh
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2020-05-13 23:35:01 +0200
committerChristian Grothoff <christian@grothoff.org>2020-05-13 23:35:01 +0200
commitd62efd6aaa7a408e04484f26d97b3b74114cc4b6 (patch)
tree5340aded408bd1f523c35c496fcc81211096c921 /http-status-codes/extend.sh
parent56eafb8f94157eecca4410ff6924715fe8328386 (diff)
downloadgana-d62efd6aaa7a408e04484f26d97b3b74114cc4b6.tar.gz
gana-d62efd6aaa7a408e04484f26d97b3b74114cc4b6.zip
setup http status code registry
Diffstat (limited to 'http-status-codes/extend.sh')
-rwxr-xr-xhttp-status-codes/extend.sh19
1 files changed, 19 insertions, 0 deletions
diff --git a/http-status-codes/extend.sh b/http-status-codes/extend.sh
new file mode 100755
index 0000000..679d541
--- /dev/null
+++ b/http-status-codes/extend.sh
@@ -0,0 +1,19 @@
1#!/bin/sh
2# Extend all IANA records with a C-style identifier in all-caps.
3set -eu
4
5TARGET="$1"
6shift
7cat "$@" > ${TARGET}
8
9for n in `seq 100 599`
10do
11 VAL=`recsel -e "Value = $n" -P Description iana.rec || true`
12 CAPS=`echo ${VAL} | tr [a-z] [A-Z] | tr " -" "__"`
13 recset -f Identifier -a "${CAPS}" -e "Value = $n" ${TARGET}
14done
15
16
17# Apply fixes for records defined differently by MHD:
18recset -f Identifier -s "SWITCH_PROXY" -e "Value = 306" ${TARGET}
19recset -f Description -s "Switch proxy (not used)" -e "Value = 306" ${TARGET}