aboutsummaryrefslogtreecommitdiff
path: root/http-status-codes/extend.sh
diff options
context:
space:
mode:
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}