]> zdv2.bktei.com Git - BK-2020-03.git/blobdiff - user/bkots
feat(unitproc/find_erotica.sh):Split one-liner into functions
[BK-2020-03.git] / user / bkots
index 3c9705ca2cb58a20ee3ebdf2d1f9e05605d178c3..8d6ecde4471a668c3c9ecbf8189bed654022e86a 100755 (executable)
@@ -1,8 +1,13 @@
 #!/usr/bin/env bash
 #!/usr/bin/env bash
+# Desc: Recursively timestamp files with OpenTimestamp
+# Usage: bkots [PATH]
+# Version: 0.2.0
 
 # Define variables
 declare -g max_job_count="2"; # default max job count
 declare -g age_threshold="60"; # min age to add file; seconds;
 
 # Define variables
 declare -g max_job_count="2"; # default max job count
 declare -g age_threshold="60"; # min age to add file; seconds;
+declare -g stamp_throttle="0.1"; # seconds delay between stamps
+declare -g stamp_throttle_fail="1"; # seconds delay if stamp errors
 declare -Ag appRollCall # Associative array for storing app status
 declare -Ag fileRollCall # Associative array for storing file status
 declare -Ag dirRollCall # Associative array for storing dir status
 declare -Ag appRollCall # Associative array for storing app status
 declare -Ag fileRollCall # Associative array for storing file status
 declare -Ag dirRollCall # Associative array for storing dir status
@@ -757,7 +762,13 @@ main() {
                 if [[ "$opVerbose" = "true" ]]; then declare -p cmd_temp; fi;
 
                 #### execute command
                 if [[ "$opVerbose" = "true" ]]; then declare -p cmd_temp; fi;
 
                 #### execute command
-                "${cmd_temp[@]}";
+                if "${cmd_temp[@]}"; then
+                    sleep "$stamp_throttle" || die "FATAL:Invalid stamp throttle.";
+                else
+                    yell "ERROR:Could not stamp file with command:$(declare -p cmd_temp)";
+                    sleep "$stamp_throttle_fail" || die "FATAL:Invalid stamp throttle.";
+                fi;
+                
                 unset cmd_temp;
                 #ots stamp "$path_src";
             else
                 unset cmd_temp;
                 #ots stamp "$path_src";
             else