Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add atq Output to Support Script #284

Merged
merged 1 commit into from
Mar 15, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 33 additions & 6 deletions support.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,44 @@ ARCH=$(uname -a)
CPUS=$(lscpu | grep "CPU(s):" | awk '{print $2}')
GIT_CHANGES=$(git diff --name-only)
SDR_INFO=$(rtl_eeprom 2>&1)
RPI_MODEL=$(cat /proc/device-tree/model)
RPI_MODEL=$(cat /proc/device-tree/model | tr -d '\0')
DISK_LAYOUT=$(lsblk)

echo "============================================="
echo "Details about environment"
echo "============================================="
echo "Current date/time: ${START_TIME}"
echo "Repo git hash: ${LATEST_GIT_HASH}"
echo "Raspberry Pi Model: ${RPI_MODEL}"
echo "Architecture: ${ARCH}"
echo "Num CPUs: ${CPUS}"
echo "Current local date/time: $(date -d @$START_TIME)"
echo "Current date/time (ms): ${START_TIME}"
echo "Repo git hash: ${LATEST_GIT_HASH}"
echo "Raspberry Pi Model: ${RPI_MODEL}"
echo "Architecture: ${ARCH}"
echo "Num CPUs: ${CPUS}"

echo "---------------------------------------------"
echo "'at' Scheduled Jobs (Captures):"

# get the at jobs
atq_jobs=()
while IFS= read -r res; do
atq_jobs+=("${res}")
done < <(atq)

# parse and save the job information
AT_COMMANDS=()
for job in "${atq_jobs[@]}"; do
job_id=$(echo "${job}" | awk '{print $1}')
cmd=$(at -c $job_id | grep -e "receive_meteor.sh" -e "receive_noaa.sh")
AT_COMMANDS+=("[${job}] -> ${cmd}")
done

# output the job details (if any available)
if [ "${#AT_COMMANDS[@]}" == "0" ]; then
echo " (None)"
else
for cmd in "${AT_COMMANDS[@]}"; do
echo " * ${cmd}"
done
fi

echo "---------------------------------------------"
echo "USB Device Map:"
Expand Down