#!/bin/sh
#/***************************************************************************
#*                                                                          *
#* Copyright 2014      Dot Hill Systems Corporation, All Rights Reserved.   *
#*                                                                          *
#* This software contains the valuable trade secrets of Dot Hill Systems    *
#* Corporation (Dot Hill).  The software is protected under copyright laws  *
#* as an unpublished work of Dot Hill.  Notice is for informational         *
#* purposed only and does not imply publication.  The user of this software *
#* may make copies of the software for use with parts manufactured by       *
#* Dot Hill or under license from Dot Hill and for no other use.            *
#*                                                                          *
#***************************************************************************/
echo "STATUS: Loading security certificate file"

# The uploadTrigger will validate key and cert, and if successful, replace the active user key/cert with the new ones (if they existed)
# and then delete key & cert in the ramdisk
# If key/cert are not valid or incomplete, it will do nothing.

certFile="/mnt/ramdisk/cert-file"
keyFile="/mnt/ramdisk/cert-key-file"

uploadScript=/app/usr/bin/ssl/uploadTrigger.sh
if [ -e /cfg/bin/ssl/uploadTrigger.sh ]; then
    uploadScript=/cfg/bin/ssl/uploadTrigger.sh
fi

${uploadScript} $keyFile $certFile

echo "Done with $0."
exit 0;

