-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnetlog.sh
More file actions
executable file
·645 lines (528 loc) · 17 KB
/
Copy pathnetlog.sh
File metadata and controls
executable file
·645 lines (528 loc) · 17 KB
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
#!/bin/bash
############################################################
# This script will automate the process of #
# Logging Calls on a Pi-Star Hotpot #
# to assist with Net Logging #
# #
# VE3RD Created 2021/07/05 #
############################################################
#set -o errexit
#set -o pipefail
set -e
#set -e
#set -o errtrace
#set -E -o functrace
ver=2023092522
sudo mount -o remount,rw /
#printf '\e[9;1t'
declare -i duri=0
callstat=""
callinfo="No Info"
lastcall2=""
lastcall1=""
netcont="none"
stat=""
dt1=""
P1="$1"
if [ ! -z "$P1" ]; then
netcont=$(echo "$P1" | tr '[:lower:]' '[:upper:]')
fi
P2="$2"
if [ "$P2" ]; then
# P2S=${P2^^}
# stat=${P2^^}
stat=$(echo "$P2" | tr '[:lower:]' '[:upper:]')
fi
P3="$3"
if [ "$P3" ]; then
P3S=${P3^^}
fi
TG="NA"
#echo "$netcont" "$stat"
dur=$((0))
cnt=$((0))
lcnt=$((0))
count=""
cntd=0
cm=0
lcm=0
ber=0
netcontdone=0
nodupes=0
rf=0
clen=$((0))
lfdts=""
dts=""
nline1=""
calli=""
src="RF" #"NET"
active=0
sline=" "
oldline=""
newline=""
pmode=""
mode=""
server=""
call=""
line2=""
yat=""
keybd="no"
amode="no"
stripped=0
err_report()
{
echo "Error on line $1"
echo "Last Call = $call"
echo "Last TCall = $tcall"
./netlog.sh ReStart
}
trap 'err_report $LINENO' ERR
fnEXIT() {
echo -e "${BOLD}${WHI}THANK YOU FOR USING NETLOG by VE3RD!${SGR0}${DEF}"
echo ""
exit
}
trap fnEXIT SIGINT SIGTERM
function getinput()
{
calli=" "
echo -n "Type a Call Sign and press enter: "
read calli
call=${calli^^}
echo ""
stty sane
cm=2
keybd="yes"
ProcessNewCall
}
function searchcall()
{
calli=" "
tput el1
echo -n "Type a Call Sign and press enter: "
read calli
call=${calli^^}
echo ""
stty sane
cm=2
keybd="yes"
cat /home/pi-star/netlog.log | grep "$call"
}
function help(){
#echo "Syntax : \./netlog.sh Param1 Param2 Param3"
echo "All Parameters are optional"
echo "Param1 can be any one of three things "
echo "1) Net Controller Call Sign. If used This must be Param 1"
echo "2) The word 'NEW' This will initalize the Log File"
echo "3) The word 'OLD' This will start by showing the log file complete with dupes"
echo "3) No Parameters will start by displaying the log file with no dupes"
echo ""
echo "You can manually enter a call sign."
echo "1) Press ENTER"
echo "2) Enter a Call Sign"
echo "3) Press ENTEE"
}
function header(){
clear
set -e sudo mount -o remount,rw /
echo ""
echo "NET Logging Program by VE3RD Version $ver"
# echo ""
echo "Dates and Times Shown are Local to your hotspot"
# echo ""
echo "Net Log Started $dates"
echo "0, Net Log Started $dates" | tee /home/pi-star/netlog.log > /dev/null
# echo "0, Net Log Started $dates" > /home/pi-star/netlog.log
echo "0" | tee ./count.val > /dev/null
echo ""
if [ ! "$netcont" ] || [ "$netcont" == "NEW" ]; then
echo "No Net Controller Specified"
netcont="N/A"
else
echo "Net Controller is $netcont"
echo ""
fi
}
#M: 2021-12-29 14:55:46.923 YSF, received network data from WB2FLX to DG-ID 0 at FCS00390
function getysf(){
ysfm=$(sed -n -r "/^\[Network\]/ { :l /^Startup[ ]*=/ { s/.*=[ ]*//; p; q;}; n; b l;}" /etc/ysfgateway)
server="$ysfm"
tg=$(echo "$nline1" | cut -d " " -f 14)
if [ "$ysfm" == "YSF2P25" ]; then
server="YSF2P25"
tg=$(sed -n -r "/^\[Network\]/ { :l /^Static[ ]*=/ { s/.*=[ ]*//; p; q;}; n; b l;}" /etc/p25gateway)
fi
}
function getnxdn(){
nxdn=$(sed -n -r "/^\[Network\]/ { :l /^Startup[ ]*=/ { s/.*=[ ]*//; p; q;}; n; b l;}" /etc/nxdngateway)
}
function getserver(){
Addr=$(sed -n -r "/^\[DMR Network\]/ { :l /^Address[ ]*=/ { s/.*=[ ]*//; p; q;}; n; b l;}" /etc/mmdvmhost)
DMRen=$(sed -n -r "/^\[DMR\]/ { :l /^Enabled[ ]*=/ { s/.*=[ ]*//; p; q;}; n; b l;}" /etc/mmdvmhost)
if [ $Addr = "127.0.0.1" ] && [ "$DMRen" = "1" ]; then
fg=$(ls /var/log/pi-star/DMRGateway* | tail -n1)
NetNum=$(tail -n1 "$fg" | cut -d " " -f 6)
server=$(sed -n -r "/^\[DMR Network "${NetNum##*( )}"\]/ { :l /^Name[ ]*=/ { s/.*=[ ]*//; p; q;}; n; b l;}" /etc/dmrgateway)
else
ms=$(sudo sed -n '/^[^#]*'"$Addr"'/p' /usr/local/etc/DMR_Hosts.txt | head -n1 | sed -E "s/[[:space:]]+/|/g" | cut -d'|' -f1)
server=$(echo "$ms" | cut -d " " -f1)
fi
sudo mount -o remount,rw /
echo "Get Server Data " >> /home/pi-star/netlog_debug.txt
}
function getuserinfo(){
stripped=0
if [ "$cm" != 6 ] && [ ! -z "$call" ] && [ "$call" != "to" ]; then
call=$(echo "$call" | cut -d "/" -f 1)
call=$(echo "$call" | cut -d "-" -f 1)
if [ $call ]; then
lines=$(sed -n '/'",$call"',/p' /usr/local/etc/stripped.csv | head -n 1)
if [ -z "$lines" ]; then
lines=$(sed -n '/'",$call"',/p' /usr/local/etc/stripped2.csv | head -n 1)
else
stripped=1
fi
if [ "$lines" ]; then
stripped=2
fi
line=$(echo "$lines" | head -n1)
if [ ! -z line ] || [ stripped == 0 ]; then
name=$(echo "$line" | cut -d "," -f 3 | cut -d " " -f 1)
# name=$(echo "$line" | cut -d "," -f 3 )
city=$(echo "$line"| cut -d "," -f 5)
state=$(echo "$line" | cut -d "," -f 6)
country=$(echo "$line" | cut -d "," -f 7)
else
callinfo="No Info"
name="NA"
city="NA"
state="NA"
country="NA"
fi
fi
fi
sudo mount -o remount,rw /
echo "End Get User Info " | tee -a /home/pi-star/netlog_debug.txt > /dev/null
}
function checkcall(){
logline=$(sed -n '/'"$call"',/p' /home/pi-star/netlog.log | head -n 1)
if [ $? != 0 ]; then
echo "Sed Error on Line $LINENO"
fi
if [ -z "$logline" ]; then
callstat="New"
else
callstat="Dup"
cnt2da=$(echo "$logline" | cut -d "," -f 1)
cnt2d=$(printf "%1.0f\n" $cnt2da)
fi
}
function Logit(){
sudo mount -o remount,rw /
## Write New Call to Log File
echo "$cnt, $mode, $dt1, $Time, $call, $name, $city, $state, $country, $dur sec $server $tg " | tee -a /home/pi-star/netlog.log > /dev/null
echo "$cnt" | tee ./count.val > /dev/null
}
function LogDup(){
sudo mount -o remount,rw /
## Write Duplicate Call to Log File
echo " -- Dup $cntd, $mode, $dt1, $Time, $call, $name, $city, $state, $country, $dur sec $server $tg " >> /home/pi-star/netlog.log
}
function ProcessNewCall(){
RED="\e[31m"
GREEN="\e[32m"
LTMAG="\e[95m"
LTGREEN="\e[92m"
LTCYAN="\e[96m"
YELLOW="\e[33m"
ENDCOLOR="\e[0m"
if [ "$keybd" == "yes" ]; then
mode="DMR"
keybd="no"
fi
sudo mount -o remount,rw /
echo "ProcessNewCall 1 $call " | tee -a /home/pi-star/netlog_debug.txt > /dev/null
getuserinfo
checkcall
# getserver
if [ "$mode" == "DMR" ]; then
getserver
fi
if [ "$mode" == "YSF" ]; then
getysf
tg="$yat"
fi
if [ "pmode" == "P25" ]; then
getp25
fi
if [ "$mode" == "NXDN" ]; then
getnxdn
fi
#echo "Process Mode - $mode : Call:$call" >> /home/pi-star/netlog_debug.txt
sudo mount -o remount,rw /
echo "ProcessNewCall - got mode info " | tee -a /home/pi-star/netlog_debug.txt > /dev/null
if [ $cm -eq 1 ]; then
fdate=$(echo "$nline1" | cut -d " " -f2)
amode="yes"
textstr=$(echo -en " ${YELLOW} Active $mode $dt1 $Time $call $name, $city, $state, $country, $server : $tg ${ENDCOLOR}")
echo "$textstr"
### echo -en "\033[1A\033"
ber=0
pl=0
# dur=0
sudo mount -o remount,rw /
echo "ProcessNewCall Active QSO $mode" | tee -a /home/pi-star/netlog_debug.txt > /dev/null
fi
if [ $cm -eq 2 ]; then
if [ "$amode" == 1 ]; then
tput cuu 1
fi
sudo mount -o remount,rw /
echo "ProcessNewCall Last Heard $mode" | tee -a /home/pi-star/netlog_debug.txt > /dev/null
if [ "$call" == "$netcont" ]; then
sudo mount -o remount,rw /
if [ "$RFMode" == 1 ]; then
printf " ${LTMAG}-------------------- $mode $dt1 $Time Net Control $netcont $name BER:$ber $tg, $server ${ENDCOLOR}\n"
else
printf " ${LTMAG}-------------------- $mode $dt1 $Time Net Control $netcont $name, $city, $state, $country, $durt sec, $tg, $server ${ENDCOLOR}\n"
fi
echo " --------------------- $mode $dt1 $Time Net Control $netcont $name, $city, $state, $country, $durt secy \n" >> /home/pi-star/netlog.log
# printf '\e[0m'
sudo mount -o remount,rw /
echo "ProcessNewCall echo net control " | tee -a /home/pi-star/netlog_debug.txt > /dev/null
fi
if [ "$call" != "$netcont" ]; then
lastcall1=""
call1=""
netcontdone=0
cm=0 # Active Call
## if [[ $LastLine == *"voice header from"* ]] && [ ! -z "$call" ]; then
if [[ $dur == *" 0."* ]] || [[ "$dur" == *" 1."* ]]; then
echo "Keyup - CallStat = $callstat"
if [ "callstat" == "New" ]; then
cnt=$((cnt+1))
printf "${LTCYAN} %-3s $mode New KeyUp %s %-8s -- %-6s %s, %s, %s, %s, %s, %s, TG:%s %s ${ENDCOLOR} \n" "$cnt" "$dt1" "$Time" "$call" "$name" "$city" "$state" "$country" " Dur: $durt sec" "PL: $pl" "$server" "$tg "
Logit
sudo mount -o remount,rw /
echo "ProcessNewCall Loged New Key Up" | tee -a /home/pi-star/netlog_debug.txt > /dev/null
fi
if [ "$callstat" == "Dup" ]; then
cnt2ds=$(sed -n '/'"$call"'/p' /home/pi-star/netlog.log | head -n 1)
if [ $? != 0 ]; then
echo "Sed Error on Line $LINENO"
fi
cnt2d=$(echo "$cnt2ds" | cut -d "," -f 1)
printf "${LTGREEN}%s SKU Dup" "$mode"
printf " %-4s %s %-8s %-6s " "$cnt2d" "$dt1" "$Time" "$call"
printf " %s, %s, %s, %s" "$name" "$city" "$state" "$country"
printf " Dur:%s, Pl:%s, Svr:%s, TG:%s ${ENDCOLOR}\n" "$durt" "$pl" "$server" "$tg"
sudo mount -o remount,rw /
LogDup
echo "ProcessNewCall Keyup Dupe " | tee -a /home/pi-star/netlog_debug.txt > /dev/null
fi
#echo "Dupe Callstat = $callstat $dur"
else # New Real Call
if [ "$callstat" == "New" ]; then
cnt=$((cnt+1))
# printf '\e[0;40m'
# printf '\e[1;36m'
if [ "$kbd" == true ]; then
printf "${LTCYAN} %-3s $mode New Call %s %-8s -- %-6s %s, %s, %s, %s, %s KeyBd, TG:%s %s ${ENDCOLOR}\n" "$cnt" "$dt1" "$Time" "$call" "$name" "$city" "$state" "$country" "$server" "$tg "
else
printf "${LTCYAN} %-3s $mode New Call %s %-8s -- %-6s %s, %s, %s, %s, Dur:%s Secs, PL:%s, TG:%s %s${ENDCOLOR}\n" "$cnt" "$dt1" "$Time" "$call" "$name" "$city" "$state" "$country" "$durt" "$pl" "$server" "$tg "
fi
Logit
sudo mount -o remount,rw /
echo "ProcessNewCall Logged New Call " | tee -a /home/pi-star/netlog_debug.txt > /dev/null
fi
if [ "$callstat" == "Dup" ] && [ "$nodupes" == 0 ]; then
## Write Duplicate Info to Screen
if [ "$kbd" == true ]; then
#
printf "${LTGREEN}$mode KBd Dup %4s %s %-8s %-6s %s,%s, %s, %s %s %s${ENDCOLOR}\n" "$cnt2d" "$dt1" "$Time" "$call" "$name" "$city" "$state" "$country" "$server" "$tg"
#printf "%s, %s, %s %s %s\n" "$city" "$state" "$country" "$server" "$tg"
else
printf "${LTGREEN}$mode Net Dup %-4s %s %-8s %-6s %s, %s, %s, %s, %s, %s %s %s${ENDCOLOR} \n" "$cnt2d" "$dt1" "$Time" "$call" "$name" "$city" "$state" "$country" " Dur: $durt sec" "PL: $pl" "$server" "$tg"
#printf " %s, %s, %s %s %s \n" "$country" " Dur: $durt sec" "PL: $pl" "$server" "$tg"
fi
# printf '\e[0m'
# fi
sudo mount -o remount,rw /
LogDup
echo "ProcessNewCall echo Duplicate Call " | tee -a /home/pi-star/netlog_debug.txt > /dev/null
fi
printf "${ENDCOLOR}"
fi # end of keyup loop
fi #end of not netcont loop
if [ active == 1 ]; then
active=0
fi
amode=0
lcm=0
fi
sudo mount -o remount,rw /
echo "ProcessNewCall End of Regular Data " | tee -a /home/pi-star/netlog_debug.txt > /dev/null
#Watchdog loop
if [ "$pmode" == "Watchdog" ]; then
sudo mount -o remount,rw /
echo "ProcessNewCall Processing Watchdog Line " | tee -a /home/pi-star/netlog_debug.txt > /dev/null
if [ "$callstat" == "New" ]; then
cnt=$((cnt+1))
printf " ${LTCYAN} New %s %s %-15s - $mode Network Watchdog Timer has Expired for %-6s %s, %s, %s, %s, %s${ENDCOLOR}\n" "$cnt" "$dt1" "$Time" "$call" "$name" "Dur: $durt sec" "PL: $pl"
Logit
fi
if [ "$callstat" == "Dup" ]; then
printf "${LTGREEN} Dup %s %s %-15s - $mode Network Watchdog Timer has Expired for %-6s %s, %s, %s, %s, %s${ENDCOLOR}\n" "$cnt2d" "$dt1" "$Time" "$call" "$name" "Dur: $durt sec" "PL: $pl"
LogDup
fi
fi
sudo mount -o remount,rw /
echo "ProcessNewCall End " | tee -a /home/pi-star/netlog_debug.txt > /dev/null
#if [ "$pmode" == "DMRK" ]; then
# printf "${LTCYAN} %-3s $mode New Call %s %-8s -- %-6s %s, %s, %s, %s, %s KeyBd, TG:%s %s ${ENDCOLOR}\n" "$cnt" "$dt1" "$Time" "$call" "$name" "$city" "$state" "$country" "$server" "$tg "
# Logit
#
#fi
}
################################
function ParseLine(){
if [[ $LastLine == *"voice header from"* ]]; then
if [ "$RFMode" == "RF-" ]; then
tg=$(echo "$LastLine" | grep -o "TG.*" | cut -d " " -f2 | tr -d ",")
dur=0
ber=0
pl=0
else
tg=$(echo "$LastLine" | grep -o "TG.*" | cut -d " " -f2 | tr -d ",")
dur=0
ber=0
pl=0
fi
fi
if [[ $LastLine == *"end of voice transmission"* ]]; then
## End of of Transmission
if [ "$RFMode" == "RF-" ]; then
tg=$(echo "$LastLine" | grep -o "TG.*" | cut -d " " -f2 | tr -d ",")
dur=$(echo "$LastLine" | grep -o "TG.*" | cut -d " " -f3)
ber=$(echo "$LastLine" | grep -o "BER:.*" | cut -d " " -f2)
echo "RF - EOT"
pl=0
else
tg=$(echo "$LastLine" | grep -o "TG.*" | cut -d " " -f2 | tr -d ",")
dur=$(echo "$LastLine" | grep -o "TG.*" | cut -d " " -f3)
ber=0
pl=$(echo "$LastLine" | grep -o "seconds.*" | cut -d " " -f2)
fi
fi
durt="$dur"
ProcessNewCall
}
function GetLastLine(){
ok=false
LastLine=$(tail -n 1 /var/log/pi-star/MMDVM-20* | tail -n 1)
if [ "$LastLine" != "$oldline" ]; then
cm=99
call=$(echo "$LastLine" | grep -o "from.*" | cut -d " " -f2)
tg=$(echo "$LastLine" | grep -o "TG.*" | cut -d " " -f2)
str="voice header"
##DMR
if [[ $LastLine == *"voice header from"* ]] && [ ! -z "$call" ]; then
cm=1 # Active Call
fi
if [[ $LastLine == *"voice transmission from"* ]] && [ ! -z "$call" ]; then
cm=2 #Call Terminated
fi
##P25
if [[ $LastLine == *"network transmission"* ]] && [ ! -z "$call" ]; then
cm=1 # Active Call
fi
if [[ $LastLine == *"network end of transmission"* ]] && [ ! -z "$call" ]; then
cm=2 #Call Terminated
fi
RFMode=
mode=$(echo "$LastLine" | cut -d " " -f4)
if [[ $LastLine == *"RF"* ]]; then
RFMode="R-$mode"
else
RFMode="N-$mode"
fi
oldline="$LastLine"
ParseLine
fi
}
function getcount(){
count=$(grep -v '^ --' /home/pi-star/netlog.log | tail -n 1 | cut -d "," -f 1)
echo "$count" > ./count.val
}
function StartUp()
{
f1=$(ls -tv /var/log/pi-star/MMDVM* | tail -n 1 )
# line1=$(tail -n 1 "$f1" | tr -s \ | sed -n -e 's/^.*to //p')
# nline1=$(tail -n 1 "$f1" | tr -s \ | sed 's/ *$//g' | sed 's/%//g' | sed 's/,//g' ) #sed 's/h//g'
nline1=$(tail -n 1 "$f1" | tr -s \ )
newline="$nline1"
oldline="$nline1"
if [ ! -f /home/pi-star/Netlog/count.val ]; then
sudo mount -o remount,rw /
echo "0" > /home/pi-star/Netlog/count.val
fi
if [ "$netcont" != "ReStart" ]; then
if [ "$netcont" == "HELP" ]; then
help
exit
fi
if [ "$netcont" == "NEW" ] || [ "$stat" == "NEW" ] || [ ! -f /home/pi-star/netlog.log ]; then
## Delete and start a new data file starting with date line
dates=$(date '+%A %Y-%m-%d %T')
header
elif [ "$netcont" == "OLD" ] || [ "$stat" == "OLD" ] || [ ! -f /home/pi-star/netlog.log ]; then
## Delete and start a new data file starting with date line
dates=$(date '+%A %Y-%m-%d %T')
cntt=$(cat ./count.val)
getcount
cnt=$((cntt))
echo "Restart Program Ver:$ver - Counter = $cnt"
cat /home/pi-star/netlog.log
# grep -v '^ --' /home/pi-star/netlog.log
# fi
elif [ "$netcont" != "NEW" ] && [ "$stat" == "NEW" ] || [ ! -f /home/pi-star/netlog.log ]; then
call="$netcont"
processnewcall
elif [ "$netcont" != "ReStart" ]; then
# cat /home/pi-star/netlog.log
grep -v '^ --' /home/pi-star/netlog.log
getcount
cntt=$(cat ./count.val)
cnt=$((cntt))
echo "Restart Program Ver:$ver - Counter = $cnt"
fi
fi
}
######## Start of Main Program
###LoopKeys
StartUp
#getnewcall
callstat=""
######### Main Loop Starts Here
#echo "Starting Loop"
while true
do
kbd=false
sudo mount -o remount,rw /
sync
while read -t0.5 -n1 k
do
if [ "$k" == "s" ]; then
searchcall
else
kbd=true
getinput
fi
done
cm=0
dt1=$(date '+%m-%d')
Time=$(date '+%T')
GetLastLine
done
done
echo "No Longer True"