diff options
Diffstat (limited to 'http-status-codes/extend.sh')
-rwxr-xr-x | http-status-codes/extend.sh | 19 |
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. | ||
3 | set -eu | ||
4 | |||
5 | TARGET="$1" | ||
6 | shift | ||
7 | cat "$@" > ${TARGET} | ||
8 | |||
9 | for n in `seq 100 599` | ||
10 | do | ||
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} | ||
14 | done | ||
15 | |||
16 | |||
17 | # Apply fixes for records defined differently by MHD: | ||
18 | recset -f Identifier -s "SWITCH_PROXY" -e "Value = 306" ${TARGET} | ||
19 | recset -f Description -s "Switch proxy (not used)" -e "Value = 306" ${TARGET} | ||