#!/bin/bash

export TOR_LOG="/var/log/tor/log"
export TOR_DIR=/var/lib/tor/data

cmd_item_list=(
"--has-consensus"
"--current-time-in-valid-range"
"--show-valid-after"
"--show-valid-until"
"--show-middle-range"
"--tor-cert-lifetime-invalid"
"--tor-cert-valid-after"
)

for cmd_item in ${cmd_item_list[@]} ; do
   output="$(/usr/local/lib64/helper-scripts/anondate $cmd_item $@)"
   exit_code="$?"
   if [ $exit_code -eq 0 ] ; then
       echo "INFO: /usr/local/lib64/helper-scripts/anondate $cmd_item $@"
       echo "output: $output"
    else
       echo "WARN: /usr/local/lib64/helper-scripts/anondate $cmd_item $@"
       echo -n "exit_code: $exit_code " 
       echo "output: $output"
      fi
done
