#!/bin/bash # # Author: # James Casey # Logic taken from yaim component "config_gip" # Updates for GLUE2 - Oliver Keeble 2011 # # Provide LFC service information for BDII # base=$(cd $(dirname $0); pwd) USAGE=$(basename $0)" --site site_name [--alias alias_name] [--local \"VO1 VO2\"] [--central \"VO3 VO4\"] [--verbose]" TEMP=$(getopt -o hc:l:s:vg --long central:,local:,alias:,site:,verbose,glue2 -- "$@") eval set -- "$TEMP" # by default the local and central VO lists are empty LFC_LOCAL="" LFC_CENTRAL="" # by default, the hostname to use is the current host LFC_HOST=`hostname -f` # by default quiet operation VERBOSE='false' # by default, no site-name SITE_NAME="" while true; do case "$1" in -a|--alias) shift LFC_HOST="$1" shift ;; -s|--site) shift SITE_NAME="$1" shift ;; -l|--local) shift LFC_LOCAL="$LFC_LOCAL $1" shift ;; -c|--central) shift LFC_CENTRAL="$LFC_CENTRAL $1" shift ;; -v|--verbose) VERBOSE='true' shift ;; -h|--help) echo $USAGE exit ;; -g|--glue2) GLUE2='true' shift ;; --) shift break ;; *) echo "Unknown option '$1'" exit ;; esac done if [ -z $SITE_NAME ] ; then echo "ERROR : No site name defined" 1>&2; exit 1; fi ####################################################################### # system parameters START_TIME=$(stat -c %z /var/run/lfcdaemon.pid 2>/dev/null) if [ -n "$START_TIME" ]; then ISO8061_START_TIME=$(date -u -d "$START_TIME" "+%Y-%m-%dT%H:%M:%SZ") fi # Please look away now LFC_VERSION=$(rpm -q --qf '%{VERSION}' lcgdm-libs) # lcgdm-libs version is always the same as LFC version if [ ! $? == 0 ]; then LFC_VERSION="" fi # GLUE 1.3 # Now create ldif fragment for central catalog if [ "$LFC_CENTRAL" ]; then cat </dev/null` if [ $? -ne 0 ]; then MIDDLEWARE_VERSION="unset" fi echo # This bit is shared by central and local LFCs cat <