Index: scripts/generate_config_files_sha.sh =================================================================== diff -u -rbf1a4562faa217a8c6e9864e8549a2c6cfa4bee8 -rf41e349e9736828dd60984f27bb558dc16cd7e03 --- scripts/generate_config_files_sha.sh (.../generate_config_files_sha.sh) (revision bf1a4562faa217a8c6e9864e8549a2c6cfa4bee8) +++ scripts/generate_config_files_sha.sh (.../generate_config_files_sha.sh) (revision f41e349e9736828dd60984f27bb558dc16cd7e03) @@ -15,23 +15,25 @@ # ############################################################################ # $1 - the path to the settings folder -# $2 - output sha file path +# $2 - The path of where conf files live on the device +# $3 - output sha file path (eg: /home/root/settings.crc) + # NOTE: The expectation is the configuration files are in a parent folder settings # eg. $HOME/project/application/resources/settings/ -if [ $# -lt 2 ]; then +if [ $# -lt 3 ]; then currentFile=$(basename "$0") - echo "Usage: ./$currentFile " + echo "Usage: ./$currentFile " exit 1003 fi # find all .conf files in the given path -find $1 -type f -name '*.conf' -exec sha256sum {} \; > $2 +find $1 -type f -name '*.conf' -exec sha256sum {} \; > "$3" # strip it of the absolute path string -sed -i "s+ .*$1+ +g" $2 +sed -i "s+ .*$1+ $2/+g" $3 if [ $? -eq 0 ]; then echo ""