Revision: 7876
http://syscheck.svn.sourceforge.net/syscheck/?rev=7876&view=rev
Author: kinneh
Date: 2009-12-16 21:25:04 +0000 (Wed, 16 Dec 2009)
Log Message:
-----------
#19 - new script to support configure(lesser) crl publishing
Added Paths:
-----------
trunk/syscheck/config/925.conf
trunk/syscheck/lang/925.english
trunk/syscheck/related-available/925_publish_crl_from_file.sh
Added: trunk/syscheck/config/925.conf
===================================================================
--- trunk/syscheck/config/925.conf (rev 0)
+++ trunk/syscheck/config/925.conf 2009-12-16 21:25:04 UTC (rev 7876)
@@ -0,0 +1,24 @@
+# config for 905_publish_crl.sh
+
+
+VERIFY_HOST[0]=localhost
+CRLTO_DIR[0]='/srv/www/crl/'
+SSHUSER[0]=
+SSHKEY[0]=
+
+VERIFY_HOST[1]=localhost
+CRLTO_DIR[1]='/srv/www/crl/'
+SSHUSER[1]=
+SSHKEY[1]=
+
+VERIFY_HOST[2]=localhost
+CRLTO_DIR[2]='/srv/www/crl/'
+SSHUSER[2]=
+SSHKEY[2]=
+
+VERIFY_HOST[3]=localhost
+CRLTO_DIR[3]='/srv/www/crl/'
+SSHUSER[3]=
+SSHKEY[3]=
+
+### end config ###
Added: trunk/syscheck/lang/925.english
===================================================================
--- trunk/syscheck/lang/925.english (rev 0)
+++ trunk/syscheck/lang/925.english 2009-12-16 21:25:04 UTC (rev 7876)
@@ -0,0 +1,10 @@
+HELP="Publish a CRL from file, ie you need to call this script with the file on disc\n$0: -c <file>|--crlfile=<file>"
+DESCR_1="Publish crl run successfully"
+HELP_1="ok"
+DESCR_2="no input file found"
+HELP_2="supply file as argument to this script"
+DESCR_3="Publish certificate failed, cant read file (%s)"
+HELP_3="verify the file is in place and with proper permissions before executing this script"
+DESCR_4="scp script failed"
+HELP_4="check the log for messages about the transfer"
+
Added: trunk/syscheck/related-available/925_publish_crl_from_file.sh
===================================================================
--- trunk/syscheck/related-available/925_publish_crl_from_file.sh (rev 0)
+++ trunk/syscheck/related-available/925_publish_crl_from_file.sh 2009-12-16 21:25:04 UTC (rev 7876)
@@ -0,0 +1,91 @@
+#!/bin/bash
+
+# The script fetches a crl from the ca and scp the crl to a webserver.
+# Change $HTTPSERVER, $SSHUSER and $SSHSERVER_DIR. Define the crl's and the servers in the end.
+# Usage:
+# get example.crl # This gets the crl from the CA server.
+# put 192.168.10.10 # This sends the crl to the webserver.
+
+# source env vars from system that dont get included when running from cron
+
+SYSCHECK_HOME=${SYSCHECK_HOME:-"/usr/local/syscheck"}
+
+# Import common resources
+. $SYSCHECK_HOME/resources.sh
+
+
+## local definitions ##
+SCRIPTID=925
+getlangfiles $SCRIPTID
+getconfig $SCRIPTID
+
+ERRNO_1=${SCRIPTID}1
+ERRNO_2=${SCRIPTID}2
+ERRNO_3=${SCRIPTID}3
+
+
+if [ "x$1" = "x--help" -o "x$1" = "x-h" ] ; then
+ /bin/echo -e "$HELP"
+ echo
+ echo "$ERRNO_1/$DESCR_1 - $HELP_1"
+ echo "$ERRNO_2/$DESCR_2 - $HELP_2"
+ echo "$ERRNO_3/$DESCR_3 - $HELP_3"
+ echo "$0 <-s|--screen>"
+ exit
+elif [ "x$1" = "x-s" -o "x$1" = "x--screen" ] ; then
+ PRINTTOSCREEN=1
+fi
+
+
+TEMP=`/usr/bin/getopt --options "hsc:" --long "help,screen,crlfile:" -- "$@"`
+if [ $? != 0 ] ; then help ; fi
+eval set -- "$TEMP"
+
+while true; do
+ case "$1" in
+ -c|--crlfile ) CRLFILE=$2; shift 2;;
+ -s|--screen ) PRINTTOSCREEN=1; shift;;
+ -b|--batch ) BATCH=1; shift;;
+ -h|--help ) schelp;shift;;
+ --) break ;;
+ esac
+done
+
+
+if [ "x${CRLFILE}" = "x" ] ; then
+ printlogmess $ERROR $ERRNO_2 "$DESCR_2"
+ exit
+fi
+
+
+if [ ! -r ${CRLFILE} ] ; then
+ printlogmess $ERROR $ERRNO_3 "$DESCR_3" ${CRLFILE}
+ exit
+fi
+
+
+put () {
+
+ CRLHOST=$1
+ CRLFILE=$2
+ SSHSERVER_DIR=$3
+ SSHKEY=$4
+ SSHUSER=$5
+
+ $SYSCHECK_HOME/related-enabled/906_ssh-copy-to-remote-machine.sh -s $CRLFILE $CRLHOST $SSHSERVER_DIR $SSHUSER $SSHKEY
+ if [ $? != 0 ] ; then
+ printlogmess $ERROR $ERRNO_4 "$DESCR_4" $CRLHOST $CRLFILE
+ else
+ printlogmess $INFO $ERRNO_1 "$DESCR_1" $CRLHOST $CRLFILE
+ fi
+}
+
+
+for (( i=0; i < ${#VERIFY_HOST[@]} ; i++ )){
+
+ put ${VERIFY_HOST[$i]} "${CRLFILE}" ${CRLTO_DIR[$i]} ${SSHKEY[$i]} ${SSHUSER[$i]}
+
+}
+
+
+
Property changes on: trunk/syscheck/related-available/925_publish_crl_from_file.sh
___________________________________________________________________
Added: svn:executable
+ *
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|