summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2021-02-22 12:41:03 -0500
committerNick Mathewson <nickm@torproject.org>2021-02-22 12:41:03 -0500
commitdcad439e94359a547eb6655bcec202c0ad3dcd93 (patch)
treeea570a5e00e304ab535f4414e64cfdafa1f540d8 /scripts
parent0d4237839b21b466526a01147538d09c117cc884 (diff)
downloadtor-dcad439e94359a547eb6655bcec202c0ad3dcd93.tar.gz
tor-dcad439e94359a547eb6655bcec202c0ad3dcd93.zip
script to generate a commit for an updated geoip file
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/maint/geoip/update_and_commit_geoip.sh34
1 files changed, 34 insertions, 0 deletions
diff --git a/scripts/maint/geoip/update_and_commit_geoip.sh b/scripts/maint/geoip/update_and_commit_geoip.sh
new file mode 100755
index 0000000000..a83f82433e
--- /dev/null
+++ b/scripts/maint/geoip/update_and_commit_geoip.sh
@@ -0,0 +1,34 @@
+#!/bin/sh
+
+set -e
+
+CMDDIR=$(cd "$(dirname "$0")" && pwd)
+
+if [ ! -e "./src/config/geoip" ] ; then
+ echo "Run this from inside the root dir of your oldest LTS repository"
+ exit 1
+fi
+
+if [ -n "$(git status --untracked-files=no --porcelain)" ]; then
+ echo "Working directory is not clean."
+ exit 1
+fi
+
+TOPDIR=$(pwd)
+cd "./src/config/"
+"${CMDDIR}/update_geoip.sh"
+cd "${TOPDIR}"
+
+DASH_DATE=$(date -u +"%Y-%m-%d")
+SLASH_DATE=$(date -u +"%Y/%m/%d")
+CHANGESFILE="changes/geoip-$DASH_DATE"
+
+cat > "$CHANGESFILE" <<EOF
+ o Minor features (geoip data):
+ - Update the geoip files to match the IPFire Location Database,
+ as retrieved on ${SLASH_DATE}.
+EOF
+
+git add "$CHANGESFILE"
+
+git commit -a -m "Update geoip files to match ipfire location db, $SLASH_DATE."