#!/bin/bash

#encrypt scripts with _enc name. will prompt for a password.
for enc_file in `find ./rh* -type f -name "*_enc"`
do
FILE="`echo $enc_file | cut -d"_" -f1-3`"
openssl enc -aes-256-cbc -salt -pbkdf2 -in $enc_file -out ${FILE}_crypt
rm -f $enc_file
done

#hash all scripts for download compare.
find . -name "*.md5" -exec rm {} \;
for file in `find rh* -type f | grep -v hash_files | grep -v README`
#for file in `find rh* -type f | grep -v hash_files | grep -v README | grep -v .md5 | grep '/'`
do
MD5="`md5sum $file | cut -d' ' -f1`"
echo $MD5 >$file.md5
done
for file in `find ./rh*/* -type d -exec find {} -name "*.md5" \;`
do
	rm -f $file
done

exit 0
