-
Notifications
You must be signed in to change notification settings - Fork 71
/
additional.function
696 lines (622 loc) · 20.7 KB
/
additional.function
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
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
#additional software to install with build-a-pi
#20200513 km4ack
TEMPCRON=${MYPATH}/cron.tmp
DIR=${MYPATH}/temp
WHO=$(whoami)
mkdir -p ${DIR}
source ${MYPATH}/config
##################################
# PAT WINLINK
##################################
PAT() {
echo "##################"
echo "installing pat"
echo "##################"
PORT=8080
cd ${DIR}
if [ -f ${HOME}/.wl2k/config.json ]; then
cp ${HOME}/.wl2k/config.json ${DIR}/config.json
fi
NEWPATV=$(curl -s https://github.com/la5nta/pat/releases | grep armhf | head -1 | sed 's/.*pat_/pat_/' | sed 's/<\/a>.*$//')
NEWPAT=$(echo ${NEWPATV} | sed 's/pat_//' | sed 's/_linux_armhf.deb//' | sed 's/0\.//')
echo "new pat v ${NEWPATV}"
echo "new pat ${NEWPAT}"
wget --tries 2 --connect-timeout=60 https://github.com/la5nta/pat/releases/download/v0.${NEWPAT}/${NEWPATV}
sudo dpkg -i ${DIR}/${NEWPATV}
pat http &
sudo killall pat
sudo systemctl start pat@${WHO}
sudo systemctl enable pat@${WHO}
cd ${DIR}
FIG=${HOME}/.wl2k/config.json
#set callsign
sed -i "s/\"mycall\": \".*\",/\"mycall\": \"${CALL}\",/" ${FIG}
#set password
WL2KPASS=$(grep "WL2KPASS" ${MYPATH}/config | sed 's/"//g' | sed 's/WL2KPASS=//')
sed -i "s/\"secure_login_password\": \".*\",/\"secure_login_password\": \""$WL2KPASS"\",/" ${FIG}
#set locator
sed -i "s/\"locator\": \".*\",/\"locator\": \"$GRID\",/" ${FIG}
#Change localhost to 0.0.0.0
sed -i "s/\"http_addr\": \".*\",/\"http_addr\": \"0.0.0.0:$PORT\",/" ${FIG}
jq '.ax25.rig = '\"my-rig\"'' ${HOME}/.wl2k/config.json | jq '.ardop.rig = '\"my-rig\"'' | jq '.hamlib_rigs = {'\"my-rig\"': {"address": "127.0.0.1:4532", "network": "tcp"}}' >~/Desktop/config.json
mv ${HOME}/Desktop/config.json ${FIG}
sed -i 's/"enable_http": false,/"enable_http": true,/' ${FIG}
if [ -f ${DIR}/config.json ]; then
mv ${DIR}/config.json ${HOME}/.wl2k/
fi
}
##################################
# PAT MENU
##################################
PAT-MENU() {
#backup config files (Issue #119)
if [ -f ${HOME}/patmenu2/config ]; then
mkdir -p ${DIR}/patconfig
cp ${HOME}/patmenu2/*config* ${DIR}/patconfig/
fi
#update pat menu
if [ -d ${HOME}/patmenu2 ]; then
rm -rf "${HOME}/patmenu2"
fi
cd ${HOME}
git clone https://github.com/km4ack/patmenu2.git ${HOME}/patmenu2 && bash ${HOME}/patmenu2/setup
sed -i "s/N0CALL/${CALL}/" ${HOME}/patmenu2/config
sed -i 's/1,0/2,0/g' ${HOME}/patmenu2/config
#restore config files
if [ -d ${DIR}/patconfig/ ]; then
mv ${DIR}/patconfig/* ${HOME}/patmenu2/
fi
}
##################################
# JS8Call
##################################
JS8CALL() {
cd ${DIR}
JS8LATE=$(curl -s http://files.js8call.com/latest.html | grep armhf | awk '{ print $2 }' | sed 's/href=//' | sed 's/"//g')
JS8PKG=$(curl -s http://files.js8call.com/latest.html | grep armhf | awk '{ print $2 }' | sed 's/\///g' | sed 's/href="http:files.js8call.com[0-9].[0-9].[0-9]//' | sed 's/"//')
wget --tries 2 --connect-timeout=60 ${JS8LATE} || echo "Can't Download JS8Call" >>${BUILDLOG}
sudo dpkg -i ${JS8PKG}
sudo apt-get --fix-broken -y install
sudo dpkg -i ${JS8PKG}
}
##################################
# WSJTX
##################################
WSJTX() {
cd ${DIR}
WSPKG=$(curl -s https://physics.princeton.edu/pulsar/k1jt/wsjtx.html | grep armhf.deb | sed 's/^.*wsjtx/wsjtx/' | sed 's/deb.*$/deb/' | head -1)
wget --tries 2 --connect-timeout=60 --no-check-certificate https://physics.princeton.edu/pulsar/k1jt/$WSPKG
WSJTXSUCCESS=$?
sudo dpkg -i $WSPKG
sudo apt-get --fix-broken -y install
sudo dpkg -i $WSPKG
#added to fix WSJTX 2.3.0
sudo sed -i "s/# en_US.UTF-8/en_US.UTF-8/g" /etc/locale.gen
sudo locale-gen
#end edit for WSJTX 2.3.0
#try sourcegorge if princeton.edu fails
WSJTX2() {
if [ "$WSJTXSUCCESS" ! = 0 ]; then
cd ${DIR}
wget --tries 2 --connect-timeout=60 https://sourceforge.net/projects/wsjt/files/wsjtx-2.2.2/wsjtx_2.2.2_armhf.deb
sudo dpkg -i wsjtx_2.2.2_armhf.deb
sudo apt-get --fix-broken -y install
sudo dpkg -i wsjtx_2.2.2_armhf.deb
fi
}
WSJTX2
}
##################################
# CONKY
##################################
CONKY() {
if ! hash conky 2>/dev/null; then
sudo apt install -y conky
fi
touch ${HOME}/Documents/mylog.txt #conky will fail to load if this file doesn't exist
touch /var/lib/misc/dnsmasq.leases #conky will fail to load if this file doesn't exist
sudo apt-get install -y ruby2.5
sudo gem install gpsd_client
sudo gem install maidenhead
cp ${MYPATH}/conky/.conkyrc ${HOME}/.conkyrc
mkdir -p ${HOME}/bin/conky
cp ${MYPATH}/conky/* ${HOME}/bin/conky/
chmod +x ${HOME}/bin/conky/get-grid ${HOME}/bin/conky/temp-conv ${HOME}/bin/conky/get-freq ${HOME}/bin/conky/grid
sed -i "s/N0CALL/${CALL}/" ${HOME}/.conkyrc
#Line below is for https://github.com/km4ack/pi-build/issues/198
echo "#Update GPS maidenhead for conky" >>${TEMPCRON}
echo "*/1 * * * * /home/pi/bin/conky/grid" >>${TEMPCRON}
#Create files needed for autostart at login
#Fix issue https://github.com/km4ack/pi-build/issues/83
cat <<EOF >${HOME}/.local/share/applications/conky.desktop
[Desktop Entry]
Name=Conky
Comment=Conky
GenericName=Conky Screen Background Monitor
Exec=conky --pause=5
Icon=/home/pi/pi-build/conky/conky-logo.png
Type=Application
Encoding=UTF-8
Terminal=false
Categories=HamRadio
Keywords=Radio
EOF
ln -sf ${HOME}/.local/share/applications/conky.desktop ${HOME}/.config/autostart/conky.desktop
#####Add setconky to main menu
chmod +x ${HOME}/pi-build/conky/setconky
cat <<EOF >${HOME}/.local/share/applications/setconky.desktop
[Desktop Entry]
Name=Conky-Prefs
Comment=Conky-Prefs
GenericName=Change Conky Preferences
Exec=/home/pi/pi-build/conky/setconky
Icon=/home/pi/pi-build/conky/conky-logo.png
Type=Application
Encoding=UTF-8
Terminal=false
Categories=Settings;DesktopSettings;GTK;X-LXDE-Settings;
Keywords=Radio,Conky
EOF
}
##################################
# M0IAX Tools
##################################
M0IAX() {
cd ${DIR} || return
wget http://m0iax.com/wp-content/uploads/2020/08/JS8CallUtils_RaspberryPi.zip
unzip JS8CallUtils_RaspberryPi.zip
rm JS8CallUtils_RaspberryPi.zip
chmod +x JS8CallUtils_v2
sudo mv JS8CallUtils_v2 /usr/local/bin
cat >m0iax.desktop <<EOF
[Desktop Entry]
Name=M0IAX JS8 Utils
GenericName=M0IAX JS8 Utils
Comment=GPS & Message Tool for JS8Call
Exec=JS8CallUtils_v2
Terminal=false
Type=Application
Categories=Network;HamRadio;
EOF
sudo mv m0iax.desktop /usr/share/applications/
}
##################################
# PYQSO
##################################
PYQSO() {
sudo apt-get install -y pyqso
}
##################################
# CQRLOG
##################################
CQRLOG() {
#sudo apt-get install -y cqrlog
sudo apt-get install -y lcl-2.0 lazarus-2.0 fp-compiler-3.0.4 fpc-3.0.4 libssl-dev git build-essential \
libmariadbclient-dev lazarus-ide lcl lcl-gtk2 lcl-nogui lcl-units lcl-utils lazarus lazarus-doc lazarus-src \
fp-units-misc fp-units-rtl fp-utils fpc fpc-source libssl-dev default-mysql-client-core default-mysql-server \
default-mysql-server-core galera-3 gawk libcgi-fast-perl libcgi-pm-perl libconfig-inifiles-perl libdbd-mysql-perl \
libdbi-perl libencode-locale-perl libfcgi-perl libhamlib-utils libhamlib2 libhtml-parser-perl libhtml-tagset-perl \
libhtml-template-perl libhttp-date-perl libhttp-message-perl libio-html-perl liblwp-mediatypes-perl \
libmariadb-dev-compat libnetpbm10 libreadline5 libterm-readkey-perl libtimedate-perl liburi-perl \
mariadb-client-10.3 mariadb-client-core-10.3 mariadb-server-10.3 mariadb-server-core-10.3 socat xplanet xplanet-images
sudo ln -s /usr/lib/arm-linux-gnueabihf/libmariadbclient.so /usr/lib/libmysqlclient.so
cd
git clone https://github.com/ok2cqr/cqrlog.git
cd cqrlog
make
sudo make install
cd ..
rm -rf cqrlog
cat >cqrlog.desktop <<EOF
[Desktop Entry]
Name=CQRLOG
Comment=Amateur Radio Logging Software
GenericName=CQRLOG
Exec=cqrlog
Icon=cqrlog
Type=Application
Terminal=false
Categories=HamRadio;Utility
EOF
sudo mv cqrlog.desktop /usr/share/applications/
}
##################################
# CHIRP
##################################
CHIRP() {
cd ${DIR} || return
wget --tries 2 --connect-timeout=60 https://trac.chirp.danplanet.com/chirp_daily/LATEST/
CHIRPBUILD=$(cat index.html | grep .tar.gz | grep chirp-daily- | awk '{ print $6 }' | sed 's/.*"//' | sed 's/>//' | sed 's/[<].*$//')
sudo apt-get -y install python-gtk2 python-serial python-libxml2
mkdir ${HOME}/chirp
cd ${HOME}/chirp || return
wget --tries 2 --connect-timeout=60 https://trac.chirp.danplanet.com/chirp_daily/LATEST/$CHIRPBUILD
tar -xzf $CHIRPBUILD
CHIRPDIR=$(echo $CHIRPBUILD | sed 's/[.].*$//')
cd $CHIRPDIR || return
sudo python setup.py install
pip install future
}
##################################
# GARIM
##################################
GARIM() {
GPKG=$(curl -s https://www.whitemesa.net/garim/src/ | grep tar.gz | tail -1 | sed 's/^.*garim/garim/' | sed 's/tar.gz.*$/tar.gz/')
cd ${DIR} || return
wget --tries 2 --connect-timeout=60 https://www.whitemesa.net/garim/src/$GPKG
tar -xzvf $GPKG
DIRR=$(echo $GPKG | sed 's/.tar.gz//')
cd ${DIRR} || return
./configure
make
sudo make install
}
##################################
# QSSTV
##################################
QSSTV() {
sudo apt-get install -y g++ libfftw3-dev qt5-default libpulse-dev libhamlib-dev libasound2-dev libv4l-dev libopenjp2-7 libopenjp2-7-dev
cd ${HOME}/Downloads || return
TAR=$(curl -s http://users.telenet.be/on4qz/qsstv/downloads/ | grep tar.gz | sed 's/.*href="//' | sed 's/">.*$//' | tail -1)
wget --tries 2 --connect-timeout=60 http://users.telenet.be/on4qz/qsstv/downloads/$TAR
tar -xvzf $TAR
SSTVTAR=$(ls -d */ | grep qss)
cd $SSTVTAR || return
qmake
make
sudo make install
cat >qsstv.desktop <<EOF
[Desktop Entry]
Name=QSSTV
Comment=Slow Scan TV
GenericName=QSSTV
Exec=/usr/local/bin/qsstv
Icon=${HOME}/GridTracker/gridtracker.png
Type=Application
Terminal=false
Categories=HamRadio;
EOF
sudo mv qsstv.desktop /usr/share/applications/
}
##################################
# GRIDTRACKER
##################################
GRIDTRACKER() {
cd ${HOME} || return
sudo apt-get install -y libgconf-2-4
#Line below changed 05JULY2021 to correct https://github.com/km4ack/pi-build/issues/253
GRIDDLL=$(curl -s https://tagloomis.com/downloads/ | grep linux-arm | sed 's/^.*href="//;s/".*//')
wget --tries 2 --connect-timeout=60 $GRIDDLL
GRIDTAR=$(echo $GRIDDLL | sed 's/.*\///g')
tar -xzvf $GRIDTAR
rm ./*.gz
OLDFOLDER=$(ls | grep Grid)
mv "$OLDFOLDER" $HOME/GridTracker
cat >gridtracker.desktop <<EOF
[Desktop Entry]
Name=GridTracker
Comment=GridTracker
GenericName=GridTracker, a WSJT-X Companion
Exec=${HOME}/GridTracker/GridTracker --disable-accelerated-2d-canvas --num-raster-threads=2
Icon=${HOME}/GridTracker/gridtracker.png
Path=${HOME}/GridTracker
Type=Application
Encoding=UTF-8
Terminal=false
Categories=HamRadio;
EOF
sudo mv gridtracker.desktop /usr/share/applications/
}
##################################
# PROPAGATION
##################################
PROPAGATION() {
sudo apt-get install -y gfortran yelp python3-gi python3-gi-cairo rarian-compat gnome-doc-utils pkg-config python3-dateutil python3-mpltoolkits.basemap python3-cairocffi libgtk-3-dev
#install primary program
cd ${HOME}/Downloads || return
wget --tries 2 --connect-timeout=60 https://www.qsl.net/hz1jw/voacapl/downloads/voacapl-0.7.2.tar.gz
tar -xzf voacapl-0.7.2.tar.gz
cd voacapl-0.7.2 || return
./configure
make
sudo make install
#install gui app for propagation reports
cd ${HOME}/Downloads
wget --tries 2 --connect-timeout=60 https://www.qsl.net/hz1jw/pythonprop/downloads/pythonprop-0.28.tar.gz
tar -xzf pythonprop-0.28.tar.gz
cd pythonprop-0.28
./configure
sudo make install
${HOME}/Downloads/voacapl-0.7.2/makeitshfbc
}
##################################
# YAAC
##################################
YAAC() {
cd ${DIR} || return
#wget --tries 2 --connect-timeout=60 https://sourceforge.net/projects/yetanotheraprsc/files/YAAC.zip/
wget --tries 2 --connect-timeout=60 https://www.ka2ddo.org/ka2ddo/YAAC.zip
sudo apt-get install -y openjdk-8-jre librxtx-java
mkdir -p ${HOME}/YAAC
cd ${HOME}/YAAC || return
touch YAAC
echo "#!/bin/bash" >>YAAC
echo "java -jar ${HOME}/YAAC/YAAC.jar" >>YAAC
chmod +x YAAC
cat >yaac.desktop <<EOF
[Desktop Entry]
Name=YAAC
GenericName=YAAC
Comment=APRS Client
Exec=${HOME}/YAAC/YAAC
Terminal=false
Type=Application
Categories=Network;HamRadio;
EOF
sudo mv yaac.desktop /usr/share/applications/
unzip -o ${DIR}/YAAC.zip
}
##################################
# XASTIR
##################################
XASTIR() {
###OLD CODE
#sudo apt-get install -y xastir
#sudo chmod +x /usr/bin/xastir
#sudo sed -i 's/Exec=xastir/Exec=sudo xastir/' /usr/share/applications/xastir.desktop
###NEW CODE 29JAN2021 Builds from source
sudo apt-get -y install build-essential automake git xorg-dev libmotif-dev graphicsmagick \
gv libcurl4-openssl-dev shapelib libshp-dev libpcre3-dev libproj-dev libdb-dev python-dev \
libax25-dev libwebp-dev libwebp-dev libgraphicsmagick1-dev festival festival-dev
cd || return
git clone https://github.com/Xastir/Xastir.git
cd Xastir || return
./bootstrap.sh
mkdir build
cd build || return
../configure
make
sudo make install
cd || return
rm -rf Xastir
cat >xastir.desktop <<EOF
[Desktop Entry]
Name=Xastir
Comment=X Amateur Station Tracking and Information Reporting
Exec=xastir
Icon=/usr/local/share/xastir/symbols/icon.png
Terminal=false
Type=Application
Categories=Network;HamRadio
Keywords=APRS;AX.25;HamRadio
EOF
sudo mv xastir.desktop /usr/share/applications/
}
##################################
# KM4ACK EES
##################################
EES() {
#install PHP7.3 if not installed
#this will also install apache2
if ! hash php7.3 2>/dev/null; then
sudo apt install -y php7.3
fi
#install ghostwriter if needed
#this is used to mod the new index.html
#page. 20200229
if ! hash ghostwriter 2>/dev/null; then
sudo apt-get install -y ghostwriter
fi
#Install the KM4ACK EES
cd ${DIR} || return
git clone https://github.com/km4ack/EES-LITE.git
cd ${DIR}/EES-LITE || return
#git dev branch of code
git checkout dev
sudo cp -r ${DIR}/EES-LITE/* /var/www/html/
rm -rf "${DIR}/EES-LITE"
cd /var/www/html || return
sudo chmod +x /var/www/html/firstrun
sudo /var/www/html/./firstrun
sudo sed -i "s/N0CALL/${CALL}/" /var/www/html/config.php
sudo sed -i 's/REMINDER\ FOR\ OPERATOR\ TO\ DO\ SOMETHING/ENABLE\ AUTO\ POST\ REPLY\ IN\ CRON/' /var/www/html/config.php
cd ${DIR} || return
#Change Pat Winlink port so it won't interfer with the EES
sed -i 's/0.0.0.0:8080/0.0.0.0:5000/' ${HOME}/.wl2k/config.json
sed -i 's/PORT=8080/PORT=5000/' ${HOME}/patmenu2/config
sudo killall pat
sudo systemctl start pat@${WHO}
#Move info.markdown from EES folder to Documents
sudo mv /var/www/html/info.markdown ${HOME}/Documents/
sudo chown ${WHO}:${WHO} ${HOME}/Documents/info.markdown
#move info.html to pi documents folder
sudo cp /var/www/html/index.html ${HOME}/Documents/info.html
sudo chown ${WHO}:${WHO} ${HOME}/Documents/info.html
#move script to be run by cron to bin dir
sudo mv /var/www/html/webcopy ${HOME}/bin/
sudo chown ${WHO}:${WHO} ${HOME}/bin/webcopy
sudo chmod +x ${HOME}/bin/webcopy
#set up cron job for EES
echo "#-----Start EES Server Options------" >>${TEMPCRON}
echo "#Move EES email to Pat Winlink Outbox" >>${TEMPCRON}
echo "*/1 * * * * /var/www/html/movetopat" >>${TEMPCRON}
echo " " >>${TEMPCRON}
echo "#Auto post replies for EES server" >>${TEMPCRON}
echo "#Default is off. Activate by removing # on line below" >>${TEMPCRON}
echo "#*/1 * * * * /var/www/html/autopostreply" >>${TEMPCRON}
echo "#Line below moves info.html to index.html when modified" >>${TEMPCRON}
echo "*/1 * * * * ${HOME}/bin/webcopy" >>${TEMPCRON}
echo "#-----End EES Server Options------" >>${TEMPCRON}
}
##################################
# Pi-APRS
##################################
PI-APRS() {
cd ${HOME} || return
git clone https://github.com/km4ack/Pi-APRS.git
sudo cp ~/Pi-APRS/piaprs.desktop /usr/share/applications
}
##################################
# HamClock Small
##################################
SMALL() {
sudo apt-get -y install make g++ libx11-dev
cd ${DIR} || return
curl -o ESPHamClock.zip http://www.clearskyinstitute.com/ham/HamClock/ESPHamClock.zip
unzip ESPHamClock.zip
rm ESPHamClock.zip
cd ESPHamClock || return
sudo make -j 4 hamclock-800x480
sudo chmod +s hamclock-800x480
sudo mv hamclock-800x480 /usr/local/bin/hamclock
rm -rf "${DIR}/ESPHamClock"
cat >${HOME}/Downloads/hamclock.desktop <<EOF
[Desktop Entry]
Name=HamClock
GenericName=Ham Clock
Comment=Ham Clock
Exec=hamclock
Icon=/usr/share/icons/Adwaita/scalable/apps/preferences-system-time-symbolic.svg
Terminal=false
Type=Application
Categories=HamRadio;
EOF
sudo mv ${HOME}/Downloads/hamclock.desktop /usr/share/applications/
}
##################################
# HamClock Large
##################################
LARGE() {
sudo apt-get -y install make g++ libx11-dev
cd ${DIR} || return
curl -o ESPHamClock.zip http://www.clearskyinstitute.com/ham/HamClock/ESPHamClock.zip
unzip ESPHamClock.zip
rm ESPHamClock.zip
cd ESPHamClock || return
sudo make -j 4 hamclock-1600x960
sudo chmod +s hamclock-1600x960
sudo mv hamclock-1600x960 /usr/local/bin/hamclock
rm -rf "${DIR}/ESPHamClock"
cat >${HOME}/Downloads/hamclock.desktop <<EOF
[Desktop Entry]
Name=HamClock
GenericName=Ham Clock
Comment=Ham Clock
Exec=hamclock
Icon=/usr/share/icons/Adwaita/scalable/apps/preferences-system-time-symbolic.svg
Terminal=false
Type=Application
Categories=HamRadio;
EOF
sudo mv ${HOME}/Downloads/hamclock.desktop /usr/share/applications/
}
##################################
# Gpredict
##################################
GPREDICT() {
sudo apt install -y gpredict
}
##################################
# TQSL
##################################
TQSL() {
sudo apt install -y cmake g++ libexpat1-dev libssl-dev libdb++-dev libcurl4-openssl-dev libwxgtk3.0-dev
cd ${HOME} || return
CUR=$(curl -s http://www.arrl.org/tqsl-download | grep "for Linux" | sed 's/.*TQSL //' | awk '{print $1}')
wget http://www.arrl.org/tqsl/tqsl-${CUR}.tar.gz
tar -xzvf tqsl-${CUR}.tar.gz
rm "tqsl-${CUR}.tar.gz"
cd tqsl-${CUR} || return
cmake .
make
sudo make install
sudo cp /home/pi/tqsl-${CUR}/apps/tqsl.desktop /usr/share/applications/
rm -rf "${HOME}/tqsl-${CUR}"
}
##################################
# XLOG
##################################
#xlog removed due to xlog bug. - https://github.com/km4ack/pi-build/issues/215
#This code left so BAP can support it again once the bug is resolved.
XLOG() {
#verify hamlib installed
if ! hash rigctld 2>/dev/null; then
cat <<EOF >${HOME}/Desktop/XLOG.txt
Xlog could not be installed because hamlib
wasn't found on the system. Use the build
a pi script to install hamlib and then try
installing xlog again.
EOF
else
TARXLOG=$(curl -s https://download.savannah.nongnu.org/releases/xlog/ |
grep 2.[0-9].[0-9][0-9].tar | sort | tail -1 | sed 's/.*xlog/xlog/' | sed 's/.sig.*$//')
DIRXLOG=$(echo ${TARXLOG} | sed 's/.tar.gz//')
cd ${HOME} || return
sudo apt-get install -y libgtkgl2.0-dev libusb-1.0-0-dev
wget https://download.savannah.nongnu.org/releases/xlog/${TARXLOG}
tar -xzvf ${TARXLOG}
rm ${TARXLOG}
cd ${DIR}XLOG || return
./configure
make
sudo make install
cd ${HOME} || return
rm -rf "${DIR}XLOG"
fi
}
##################################
# HAMRS
##################################
HAMRS() {
cd ${HOME}/Downloads
DL=$(curl https://www.hamrs.app | grep armv7 | sed 's/^.*href="//;s/">//')
wget ${DL}
HAMRS=$(ls | grep hamrs)
mv ${HAMRS} hamrs
chmod +x hamrs
sudo mv hamrs /usr/local/bin/
#create menu item and download icon
cat >${HOME}/Downloads/hamrs.desktop <<EOF
[Desktop Entry]
Name=HAMRS
Comment=POTA Logging Software
Exec=/usr/local/bin/hamrs
Icon=/usr/share/pixmaps/hamrs-logo.png
Terminal=false
Type=Application
Categories=HamRadio
EOF
sudo mv ${HOME}/Downloads/hamrs.desktop /usr/share/applications/
cd $HOME/Downloads
wget https://github.com/km4ack/pi-scripts/raw/master/hamrs-logo.png
sudo mv $HOME/Downloads/hamrs-logo.png /usr/share/pixmaps/hamrs-logo.png
}
##################################
# Grid-Calc
##################################
GRIDCALC(){
sudo apt install -y wwl bc
cd $HOME/bin
wget https://raw.githubusercontent.com/km4ack/pi-scripts/master/grid-calc
chmod +x $HOME/bin/grid-calc
$HOME/bin/grid-calc
}
##################################
# JTDX
##################################
#This code is left in place but no option is given during inital
#run or update because the jtdx website is down.
#see https://github.com/km4ack/pi-build/issues/153
#14OCT2020 KM4ACK
JTDX() {
cd ${HOME}
#curl won't work here. Returns "forbidden" Use wget instead
wget -qO jtdx.txt https://www.jtdx.tech/en/
VER=$(grep armhf.deb jtdx.txt | awk '{print $2}' | sed 's/"//g' | sed 's/href=\/downloads\/Linux\///')
rm jtdx.txt
wget https://www.jtdx.tech/downloads/Linux/${VER}
sudo dpkg -i ${VER}
sudo apt-get --fix-broken -y install
sudo dpkg -i ${VER}
rm ${VER}
}