summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichał 'rysiek' Woźniak <rysiek@hackerspace.pl>2017-02-24 14:12:06 +0100
committerMichał 'rysiek' Woźniak <rysiek@hackerspace.pl>2017-02-24 14:12:06 +0100
commitbe0f098e01e5083cf804ae3f4cd4202f5cc922be (patch)
treea0cc903d84f4afafb49df79e7d42598ab94e3e87
parent9d937f2d491fa501962b5b7f1a2b3c9b06b3d150 (diff)
downloadkuvert-be0f098e01e5083cf804ae3f4cd4202f5cc922be.tar.gz
kuvert-be0f098e01e5083cf804ae3f4cd4202f5cc922be.tar.bz2
kuvert-be0f098e01e5083cf804ae3f4cd4202f5cc922be.zip
run.sh: better handling of inotifywait and keyring files
-rw-r--r--run.sh8
1 files changed, 5 insertions, 3 deletions
diff --git a/run.sh b/run.sh
index 4a0eb96..b56db38 100644
--- a/run.sh
+++ b/run.sh
@@ -190,12 +190,14 @@ function watch_pubkeys {
# FIXME we need to handle SIGHUP/SIGTERM/SIGKILL nicely some day
while true; do
# wait for events
- inotifywait -r -e modify -e move -e create -e delete -qq "$KUVERT_GNUPG_DIR"
+ inotifywait -r -e modify -e move -e create -e delete -qq "$KUVERT_GNUPG_DIR/"*.gpg "$KUVERT_GNUPG_DIR/"*.gpg~
# if a watched event occured, redo authorized_keys
if [ $? -eq 0 ]; then
echo " +-- files in $KUVERT_GNUPG_DIR changed"
- echo " reloading kuvert config and keuring in 5s..."
- sleep 5
+ echo " +-- making sure permissions are AOK..."
+ chown -R "$KUVERT_USER":"$KUVERT_GROUP" "$KUVERT_GNUPG_DIR"
+ chmod -R u=rwX,go= "$KUVERT_GNUPG_DIR"
+ echo " +-- reloading kuvert config and keyring..."
su -p -c "env PATH=\"$PATH\" kuvert -r" "$KUVERT_USER"
fi
done