From 8e45022be294f05350d57bdf1658d0112e280a42 Mon Sep 17 00:00:00 2001 From: dede Date: Fri, 21 Jul 2023 20:40:13 +0200 Subject: [PATCH] add some ideas for improvements --- TODO.md | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 TODO.md diff --git a/TODO.md b/TODO.md new file mode 100644 index 0000000..7991c2f --- /dev/null +++ b/TODO.md @@ -0,0 +1,32 @@ +# TODO + +## easy cert revocation + +here comes an example for watching file changes +the idea is to extend the step-ca container to be able to revoke certificates easily. +not that i think this is needed 0:-) + +source: https://stackoverflow.com/questions/22884580/bash-a-way-to-watch-files-for-changes#22885210 + +```bash +#!/bin/bash + +watched_files=$@ # pass watched files as cmd line arguments + +if [ -z "$watched_files" ]; then + echo "Nothing to watch, abort" + exit +else + echo "watching: $watched_files" +fi + +previous_checksum="dummy" +while [ 1 ]; do + checksum=$(md5sum $watched_files | md5sum) + if [ "$checksum" != "$previous_checksum" ]; then + echo "None shall pass!" # do your stuff here + fi + previous_checksum="$checksum" + sleep 1 +done +```