[csw-devel] SF.net SVN: opencsw:[429] catalog_signatures/bin/daemon_verify

bdwalton at users.sourceforge.net bdwalton at users.sourceforge.net
Thu Jul 21 05:09:25 CEST 2011


Revision: 429
          http://opencsw.svn.sourceforge.net/opencsw/?rev=429&view=rev
Author:   bdwalton
Date:     2011-07-21 03:09:25 +0000 (Thu, 21 Jul 2011)

Log Message:
-----------
add a script that monitors the ability to sign a file, indicating cached passphrase is still valid

Signed-off-by: Ben Walton <bwalton at opencsw.org>

Added Paths:
-----------
    catalog_signatures/bin/daemon_verify

Added: catalog_signatures/bin/daemon_verify
===================================================================
--- catalog_signatures/bin/daemon_verify	                        (rev 0)
+++ catalog_signatures/bin/daemon_verify	2011-07-21 03:09:25 UTC (rev 429)
@@ -0,0 +1,36 @@
+#!/opt/csw/bin/bash
+
+PATH=/opt/csw/bin:/opt/csw/gnu:$PATH
+
+DAEMON_BIN="$(dirname $0)"
+DAEMON_HOME="${DAEMON_BIN}/.."
+DAEMON_GPG="${DAEMON_HOME}/gpg"
+DAEMON_TMP="${DAEMON_HOME}/tmp"
+GPG_ENV="${DAEMON_TMP}/gpg-agent.conf"
+DAEMON="${DAEMON_BIN}/catalog_gpg"
+
+while [ ! -f "${GPG_ENV}" ]; do
+    echo "Waiting for GPG agent to be started by the daemon init."
+    sleep 10
+done
+
+source "${GPG_ENV}"
+export GPG_AGENT_INFO
+export GPG_TTY=`tty`
+if [ ! -d "$(dirname ${GPG_AGENT_INFO})" ]; then
+    echo "${GPG_ENV} exists but seems invalid."
+    exit 1
+fi
+
+while /bin/true; do
+    # test that the passphrase is still cached...
+    gpg --yes --batch --homedir "${DAEMON_GPG}" --clearsign --armor --output "${DAEMON_TMP}/$(basename ${DAEMON}).asc" "${DAEMON}"
+
+    if [ $? eq 0 ]; then
+	echo "$(date +%c): Ok."
+	sleep 60
+    else
+	echo "$(date +%c): AHA!  The passphrase has expired...press ENTER"
+	read CONT
+    fi
+done


Property changes on: catalog_signatures/bin/daemon_verify
___________________________________________________________________
Added: svn:executable
   + *


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.


More information about the devel mailing list