#!/bin/sh ########################################################################### # # Copyright (c) 2021-2023 Diality Inc. - All Rights Reserved. # # THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, IN PART OR IN # WHOLE, WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. # # @file generate_config_files_sha.sh # # @author (last) Vy # @date (last) 25-Jul-2023 # @author (original) Vy # @date (original) 25-Jul-2023 # ############################################################################ # $1 - the path to the settings folder # $2 - output sha file path # NOTE: The expectation is the configuration files are in a parent folder settings # eg. $HOME/project/application/resources/settings/ if [ $# -lt 2 ]; then currentFile=$(basename "$0") echo "Usage: ./$currentFile " exit 1003 fi # find all .conf files in the given path find $1 -type f -name '*.conf' -exec sha256sum {} \; > $2 # strip it of the absolute path string sed -i "s+ .*$1/+ +g" $2 if [ $? -eq 0 ]; then echo "" exit 0 else echo "Generation of SHA file failed." exit 1002 fi