-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbulk.sh
executable file
·68 lines (64 loc) · 2.12 KB
/
bulk.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#!/bin/bash
# load config elements
source clogger.cfg
source "$contest"
myskcc="18144T"
logfile="./logs/bulklog.adi"
logqso() {
echo "<CALL:${#dxcall}>$dxcall" | tr '[:lower:]' '[:upper:]' >> "$logfile"
echo " <BAND:${#band}>$band" | tr '[:lower:]' '[:upper:]' >> "$logfile"
echo " <FREQ:${#mhz}>$mhz" | tr '[:lower:]' '[:upper:]' >> "$logfile"
echo " <MODE:${#mode}>$mode" | tr '[:lower:]' '[:upper:]' >> "$logfile"
echo " <QSO_DATE:${#date}>$date" | tr '[:lower:]' '[:upper:]' >> "$logfile"
echo " <TIME_ON:${#timeon}>$timeon" | tr '[:lower:]' '[:upper:]' >> "$logfile"
echo " <OPERATOR:${#decall}>$decall" | tr '[:lower:]' '[:upper:]' >> "$logfile"
echo " <RST_SENT:${#sentrs}>$sentrs" | tr '[:lower:]' '[:upper:]' >> "$logfile"
echo " <RST_RCVD:${#recvrs}>$recvrs" | tr '[:lower:]' '[:upper:]' >> "$logfile"
echo " <COMMENT:${#comments}>$comments" | tr '[:lower:]' '[:upper:]' >> "$logfile"
if [ ! -z "$skcc" ]
then
echo " <SKCC:${#skcc}>$skcc" | tr '[:lower:]' '[:upper:]' >> "$logfile"
echo " <MY_SKCC:${#myskcc}>$myskcc" | tr '[:lower:]' '[:upper:]' >> "$logfile"
fi
echo "<EOR>" | tr '[:lower:]' '[:upper:]' >> "$logfile"
}
decall="KK0ECT"
band="20M"
mode="CW"
timeon=$(date -u +%H%M)
sentrs="599"
recvrs="599"
while true
do
clear
timeon=$(date -u +%H%M)
skcc=""
dxcall=""
read -e -i "$dxcall" -p "dxcall: " input
dxcall="${input:-$dxcall}"
worked=""
worked=$(grep -i -A 9 $dxcall ./logs/complete_log.adi | grep 'CALL\|DATE\|COMMENT' | tail -3 | cut -d'>' -f2)
if [ ! -z "$worked" ]
then
notify-send "$worked"
fi
read -e -i "$band" -p "band: " input
band="${input:-$band}"
read -e -i "$mhz" -p "mhz: " input
mhz="${input:-$mhz}"
date=$(date -u +"%Y%m%d")
read -e -i "$date" -p "date: " input
date="${input:-$date}"
read -e -i "$timeon" -p "time: " input
timeon="${input:-$timeon}"
read -e -i "$sentrs" -p "sent rst: " input
sentrs="${input:-$sentrs}"
read -e -i "$recvrs" -p "recv rst: " input
recvrs="${input:-$recvrs}"
read -p "comment: " comments
if [[ "$comments" == *"skcc"* ]]; then
skcc=$(awk -F 'skcc' '{print $2}' <<< "$comments")
skcc=$(echo "$skcc" | tr -d' ')
fi
logqso
done