Skip to content

Commit

Permalink
Merge pull request #287 from colinluthier/scan_for_update
Browse files Browse the repository at this point in the history
Scan for update
  • Loading branch information
jekhokie authored Mar 17, 2021
2 parents d43747b + 9c208a0 commit 8bdbcf6
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
8 changes: 8 additions & 0 deletions ansible/roles/common/tasks/tools.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,14 @@
group: pi
mode: 0755

- name: create scanner directory
file:
path: "{{ noaa_home }}/tmp/scanner"
state: directory
owner: pi
group: pi
mode: 0755

- name: create images directory
become: yes
file:
Expand Down
14 changes: 8 additions & 6 deletions scripts/testing/scan_for.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
scriptpath="$( cd "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )"
duration=$1
outfile=timed_scan_$(date +"%d.%m.%y-%H.%M").csv.gz
outpath=$HOME/raspberry-noaa-v2/tmp/scanner

if ! [[ "$duration" =~ ^[0-9]+[s,m,h]*$ ]] ; then
echo "
Expand All @@ -22,18 +23,19 @@ if ! [[ "$duration" =~ ^[0-9]+[s,m,h]*$ ]] ; then
fi

startdate=$(date)
secs=$($scriptppath/t2sec.sh $duration)
echo -n "Starting at "
secs=$($scriptpath/t2sec.sh $duration)
echo ""
echo -n " Starting at "
echo $startdate
echo -n "Finishing at "
echo -n " Finishing at "
date --date "$start $secs sec"

echo "
$(tput setaf 2)
Scanning for $duration, expect a $outfile.png in $(pwd) afterwards.
Scanning for $duration, expect a $outfile.png in $outpath afterwards.
$(tput sgr0)"

$scriptpath/start_scanning.sh $outfile
$scriptpath/start_scanning.sh $outpath/$outfile
sleep 1
if ! pidof rtl_power >/dev/null ; then
echo "
Expand All @@ -43,4 +45,4 @@ if ! pidof rtl_power >/dev/null ; then
exit -1
fi

nohup &>/dev/null bash -c "sleep $duration; $scriptpath/stop_and_finalize_scanning.sh $outfile" &
nohup &>/dev/null bash -c "sleep $duration; $scriptpath/stop_and_finalize_scanning.sh $outpath/$outfile" &

0 comments on commit 8bdbcf6

Please sign in to comment.