diff --git a/bin/check_assets.bash b/bin/check_assets.bash new file mode 100755 index 0000000..a1d3c9e --- /dev/null +++ b/bin/check_assets.bash @@ -0,0 +1,27 @@ +#!/bin/bash + +# CC-0 Ken Fallon + +assets_db="assets_202410181601.csv" +total="$( wc -l assets_202410181601.csv | awk '{print $1}' )" +count=1 +awk '{print $2}' "${assets_db}" | grep -E 'ogg|spx|mp3' | while read this_asset_name +do + this_asset="/mnt/data/HPR/${this_asset_name}" + #echo -ne "\r$(\date "+%Y-%m-%d %H:%M:%S") The scanner lid is CLOSED. \r" + if [ ! -s "${this_asset}" ] + then + echo "ERROR: \"${this_asset}\" missing." + else + this_size="$( ls -al "${this_asset}" | awk '{print $5}' )" + this_sha1sum="$( sha1sum "${this_asset}" | awk '{print $1}' )" + if [ "$( grep -cE "${this_asset_name}.*${this_size}.*${this_sha1sum}" "${assets_db}" )" -ne 1 ] + then + echo "ERROR: \"${this_asset}\" incorrect properties." + fi + fi + echo -ne "\rProcessing ${count} of ${total}" + count=$((count+1)) +done + +exit diff --git a/bin/run-speedtest.bash b/bin/run-speedtest.bash new file mode 100644 index 0000000..f90885a --- /dev/null +++ b/bin/run-speedtest.bash @@ -0,0 +1,6 @@ +#!/bin/bash + +# * * * * * /usr/local/bin/run-speedtest.bash >/dev/null 2>&1 + +speedtest-cli --json | jq '.' > /var/www/html/speedtest.json +chown apache:apache /var/www/html/speedtest.json diff --git a/hub/redirect.php b/hub/redirect.php new file mode 100644 index 0000000..3a376ae --- /dev/null +++ b/hub/redirect.php @@ -0,0 +1,7 @@ + request_confirm.php > upload.php > upload_confirm.php +#require "/home/hpr/php/include.php"; +?> +