Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Compute list of IdP DisplayNames
Tom Scavo committed May 6, 2017
1 parent bc88887 commit 1ce8524
Showing 1 changed file with 22 additions and 5 deletions.
27 changes: 22 additions & 5 deletions bin/process_main_aggregate.sh
@@ -27,6 +27,7 @@ display_help () {
$csv_filename1
$csv_filename2
$csv_filename3
The script is intended to be run as a cron job. It can (and
should) be run often, to pick up the latest changes to metadata.
@@ -108,8 +109,9 @@ if [ -z "$LOG_LEVEL" ]; then
fi

# output filenames
csv_filename1="all-idps-rands.csv"
csv_filename2="all-sps-rands.csv"
csv_filename1="all-idp-displaynames.csv"
csv_filename2="all-idps-rands.csv"
csv_filename3="all-sps-rands.csv"

#######################################################################
# Process command-line options and arguments
@@ -182,16 +184,21 @@ if [ $status_code -ne 0 ]; then
fi

# XSL stylesheets must exist
xsl_file1=$LIB_DIR/list_all_RandS_IdPs_csv.xsl
xsl_file1=$LIB_DIR/list_all_IdP_DisplayNames_csv.xsl
if [ ! -f "$xsl_file1" ]; then
echo "ERROR: $script_name: lib file does not exist: $xsl_file1" >&2
exit 2
fi
xsl_file2=$LIB_DIR/list_all_RandS_SPs_csv.xsl
xsl_file2=$LIB_DIR/list_all_RandS_IdPs_csv.xsl
if [ ! -f "$xsl_file2" ]; then
echo "ERROR: $script_name: lib file does not exist: $xsl_file2" >&2
exit 2
fi
xsl_file3=$LIB_DIR/list_all_RandS_SPs_csv.xsl
if [ ! -f "$xsl_file3" ]; then
echo "ERROR: $script_name: lib file does not exist: $xsl_file3" >&2
exit 2
fi

# create a temporary subdirectory
tmp_dir="${TMPDIR%%/}/${script_name%%.*}_$$"
@@ -208,6 +215,7 @@ xml_file="${tmp_dir}/saml-metadata.xml"
# output files
csv_file1="${tmp_dir}/$csv_filename1"
csv_file2="${tmp_dir}/$csv_filename2"
csv_file3="${tmp_dir}/$csv_filename3"

#######################################################################
# Main processing
@@ -251,9 +259,18 @@ if [ $exit_code -ne 0 ]; then
clean_up_and_exit -d "$tmp_dir" $exit_code
fi

# create the third output file
print_log_message -D "$script_name writing output file: $csv_file3"
/usr/bin/xsltproc $xsl_file3 $xml_file > $csv_file3
exit_code=$?
if [ $exit_code -ne 0 ]; then
print_log_message -E "$script_name: xsltproc failed ($exit_code) on stylesheet: $xsl_file3"
clean_up_and_exit -d "$tmp_dir" $exit_code
fi

# move the output files to the web directory
print_log_message -D "$script_name moving output files to dir: $out_dir"
/bin/mv $csv_file1 $csv_file2 $out_dir
/bin/mv $csv_file1 $csv_file2 $csv_file3 $out_dir
exit_code=$?
if [ $exit_code -ne 0 ]; then
print_log_message -E "$script_name: mv failed ($exit_code) to dir: $out_dir"

0 comments on commit 1ce8524

Please sign in to comment.