General Formatting and Syntax. Fixed a few dangerous rm statments too.

pull/236/head
Hugh 2021-03-16 12:39:25 -04:00
rodzic 4b84194c77
commit 5c21b2bbaa
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 47398A08D38CF50B
10 zmienionych plików z 2372 dodań i 2533 usunięć

Wyświetl plik

@ -1,12 +1,12 @@
#!/bin/bash
MYPATH="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
LOGO=$MYPATH/logo.png
MYPATH="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)"
LOGO=${MYPATH}/logo.png
cat <<EOF > $MYPATH/boot.txt
cat <<EOF >${MYPATH}/boot.txt
Build-a-Pi Build Complete.
If you found this script helpful
If you found this script helpful
consider a donation to encourage
future development.
@ -16,19 +16,20 @@ https://paypal.me/km4ack
EOF
OUT=$(yad --width=550 --height=300 --text-align=center --center --title="Build-a-Pi" --show-uri \
--image $LOGO --window-icon=$LOGO --image-on-top --separator="|" --item-separator="|" \
--text-info<$MYPATH/boot.txt \
--button="CLOSE":2 > /dev/null 2>&1)
OUT=$(yad --width=550 --height=300 --text-align=center --center --title="Build-a-Pi" --show-uri \
--image ${LOGO} --window-icon=${LOGO} --image-on-top --separator="|" --item-separator="|" \
--text-info \
--button="CLOSE":2 <${MYPATH}/boot.txt \
>/dev/null 2>&1)
BUT=$?
if [ $BUT = 252 ]; then
rm $MYPATH/boot.txt
crontab -l > $HOME/Documents/cron.tmp
sed -i 's/@reboot\ sleep\ 10.*//' $HOME/Documents/cron.tmp
crontab $HOME/Documents/cron.tmp
exit
rm ${MYPATH}/boot.txt
crontab -l >${HOME}/Documents/cron.tmp
sed -i 's/@reboot\ sleep\ 10.*//' ${HOME}/Documents/cron.tmp
crontab ${HOME}/Documents/cron.tmp
exit
fi
rm $MYPATH/boot.txt
crontab -l > $HOME/Documents/cron.tmp
sed -i 's/@reboot\ sleep\ 10.*//' $HOME/Documents/cron.tmp
crontab $HOME/Documents/cron.tmp
rm ${MYPATH}/boot.txt
crontab -l >${HOME}/Documents/cron.tmp
sed -i 's/@reboot\ sleep\ 10.*//' ${HOME}/Documents/cron.tmp
crontab ${HOME}/Documents/cron.tmp

164
.funfacts
Wyświetl plik

@ -1,151 +1,123 @@
#!/bin/bash
#20200515 km4ack
#20200515 km4ack
MYPATH="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
LOGO=$MYPATH/logo.png
MYPATH="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)"
LOGO=${MYPATH}/logo.png
yad --width=400 --height=200 --title="KM4ACK Fun Facts" --timeout=30 --image ${LOGO} --text-align=center --skip-taskbar --image-on-top \
--wrap --no-buttons --center --window-icon=${LOGO} --undecorated --text="<big><big><big><b>\r\rKM4ACK\rFun Facts</b></big></big></big>\r\r \
There are over 1500 lines of code in Build-a-Pi"
yad --width=400 --height=200 --title="KM4ACK Fun Facts" --timeout=30 --image $LOGO --text-align=center --skip-taskbar --image-on-top \
--wrap --no-buttons --center --window-icon=$LOGO --undecorated --text="<big><big><big><b>\r\rKM4ACK\rFun Facts</b></big></big></big>\r\r \
There are over 1500 lines of code in Build-a-Pi"
yad --width=400 --height=200 --title="Fun Facts" --timeout=30 --image $LOGO --text-align=center --skip-taskbar --image-on-top \
--wrap --no-buttons --center --window-icon=$LOGO --undecorated --text="<big><big><big><b>\r\rKM4ACK\rFun Facts</b></big></big></big>\r\r \
yad --width=400 --height=200 --title="Fun Facts" --timeout=30 --image ${LOGO} --text-align=center --skip-taskbar --image-on-top \
--wrap --no-buttons --center --window-icon=${LOGO} --undecorated --text="<big><big><big><b>\r\rKM4ACK\rFun Facts</b></big></big></big>\r\r \
When he released his first video, he had never written a bash script"
yad --width=400 --height=200 --title="Fun Facts" --timeout=30 --image $LOGO --text-align=center --skip-taskbar --image-on-top \
--wrap --no-buttons --center --window-icon=$LOGO --undecorated --text="<big><big><big><b>\r\rKM4ACK\rFun Facts</b></big></big></big>\r\r \
yad --width=400 --height=200 --title="Fun Facts" --timeout=30 --image ${LOGO} --text-align=center --skip-taskbar --image-on-top \
--wrap --no-buttons --center --window-icon=${LOGO} --undecorated --text="<big><big><big><b>\r\rKM4ACK\rFun Facts</b></big></big></big>\r\r \
He studied for a week and then drove 1 1/2 hours to take the technician exam because it was the closest test location that weekend."
yad --width=400 --height=200 --title="Fun Facts" --timeout=30 --image $LOGO --text-align=center --skip-taskbar --image-on-top \
--wrap --no-buttons --center --window-icon=$LOGO --undecorated --text="<big><big><big><b>\r\rKM4ACK\rFun Facts</b></big></big></big>\r\r \
yad --width=400 --height=200 --title="Fun Facts" --timeout=30 --image ${LOGO} --text-align=center --skip-taskbar --image-on-top \
--wrap --no-buttons --center --window-icon=${LOGO} --undecorated --text="<big><big><big><b>\r\rKM4ACK\rFun Facts</b></big></big></big>\r\r \
A year after passing the tech exam, he passed the extra exam"
yad --width=400 --height=200 --title="Fun Facts" --timeout=30 --image $LOGO --text-align=center --skip-taskbar --image-on-top \
--wrap --no-buttons --center --window-icon=$LOGO --undecorated --text="<big><big><big><b>\r\rKM4ACK\rFun Facts</b></big></big></big>\r\r \
yad --width=400 --height=200 --title="Fun Facts" --timeout=30 --image ${LOGO} --text-align=center --skip-taskbar --image-on-top \
--wrap --no-buttons --center --window-icon=${LOGO} --undecorated --text="<big><big><big><b>\r\rKM4ACK\rFun Facts</b></big></big></big>\r\r \
He doesn't know CW. dit dit"
yad --width=400 --height=200 --title="Fun Facts" --timeout=30 --image $LOGO --text-align=center --skip-taskbar --image-on-top \
--wrap --no-buttons --center --window-icon=$LOGO --undecorated --text="<big><big><big><b>\r\rKM4ACK\rFun Facts</b></big></big></big>\r\r \
He released his first ham radio video on YouTube in 2018"
yad --width=400 --height=200 --title="Fun Facts" --timeout=30 --image ${LOGO} --text-align=center --skip-taskbar --image-on-top \
--wrap --no-buttons --center --window-icon=${LOGO} --undecorated --text="<big><big><big><b>\r\rKM4ACK\rFun Facts</b></big></big></big>\r\r \
He released his first ham radio video on YouTube in 2018"
yad --width=400 --height=200 --title="Fun Facts" --timeout=30 --image $LOGO --text-align=center --skip-taskbar --image-on-top \
--wrap --no-buttons --center --window-icon=$LOGO --undecorated --text="<big><big><big><b>\r\rKM4ACK\rFun Facts</b></big></big></big>\r\r \
The Emergency Email Server was the first and last thing he programmed in PHP"
yad --width=400 --height=200 --title="Fun Facts" --timeout=30 --image ${LOGO} --text-align=center --skip-taskbar --image-on-top \
--wrap --no-buttons --center --window-icon=${LOGO} --undecorated --text="<big><big><big><b>\r\rKM4ACK\rFun Facts</b></big></big></big>\r\r \
The Emergency Email Server was the first and last thing he programmed in PHP"
yad --width=400 --height=200 --title="Fun Facts" --timeout=30 --image $LOGO --text-align=center --skip-taskbar --image-on-top \
--wrap --no-buttons --center --window-icon=$LOGO --undecorated --text="<big><big><big><b>\r\rKM4ACK\rFun Facts</b></big></big></big>\r\r \
Patrons get to test his very latest software before they go public. Join in on the fun. https://patreon.com/km4ack"
yad --width=400 --height=200 --title="Fun Facts" --timeout=30 --image ${LOGO} --text-align=center --skip-taskbar --image-on-top \
--wrap --no-buttons --center --window-icon=${LOGO} --undecorated --text="<big><big><big><b>\r\rKM4ACK\rFun Facts</b></big></big></big>\r\r \
Patrons get to test his very latest software before they go public. Join in on the fun. https://patreon.com/km4ack"
yad --width=400 --height=200 --title="Fun Facts" --timeout=30 --image $LOGO --text-align=center --skip-taskbar --image-on-top \
--wrap --no-buttons --center --window-icon=$LOGO --undecorated --text="<big><big><big><b>\r\rKM4ACK\rFun Facts</b></big></big></big>\r\r \
His Jeep is a trail rated 2007 Wrangler X"
yad --width=400 --height=200 --title="Fun Facts" --timeout=30 --image ${LOGO} --text-align=center --skip-taskbar --image-on-top \
--wrap --no-buttons --center --window-icon=${LOGO} --undecorated --text="<big><big><big><b>\r\rKM4ACK\rFun Facts</b></big></big></big>\r\r \
His Jeep is a trail rated 2007 Wrangler X"
yad --width=400 --height=200 --title="Fun Facts" --timeout=30 --image $LOGO --text-align=center --skip-taskbar --image-on-top \
--wrap --no-buttons --center --window-icon=$LOGO --undecorated --text="<big><big><big><b>\r\rKM4ACK\rFun Facts</b></big></big></big>\r\r \
yad --width=400 --height=200 --title="Fun Facts" --timeout=30 --image ${LOGO} --text-align=center --skip-taskbar --image-on-top \
--wrap --no-buttons --center --window-icon=${LOGO} --undecorated --text="<big><big><big><b>\r\rKM4ACK\rFun Facts</b></big></big></big>\r\r \
Yes. He has a Raspberry Pi in the Jeep"
yad --width=400 --height=200 --title="Fun Facts" --timeout=30 --image $LOGO --text-align=center --skip-taskbar --image-on-top \
--wrap --no-buttons --center --window-icon=$LOGO --undecorated --text="<big><big><big><b>\r\rKM4ACK\rFun Facts</b></big></big></big>\r\r \
yad --width=400 --height=200 --title="Fun Facts" --timeout=30 --image ${LOGO} --text-align=center --skip-taskbar --image-on-top \
--wrap --no-buttons --center --window-icon=${LOGO} --undecorated --text="<big><big><big><b>\r\rKM4ACK\rFun Facts</b></big></big></big>\r\r \
The Jeep also houses an 857D for HF and a FTM400 for 2M and 440"
yad --width=400 --height=200 --title="Fun Facts" --timeout=30 --image $LOGO --text-align=center --skip-taskbar --image-on-top \
--wrap --no-buttons --center --window-icon=$LOGO --undecorated --text="<big><big><big><b>\r\rKM4ACK\rFun Facts</b></big></big></big>\r\r \
yad --width=400 --height=200 --title="Fun Facts" --timeout=30 --image ${LOGO} --text-align=center --skip-taskbar --image-on-top \
--wrap --no-buttons --center --window-icon=${LOGO} --undecorated --text="<big><big><big><b>\r\rKM4ACK\rFun Facts</b></big></big></big>\r\r \
There is also a Yaesu FT65r on the sun visor ready to grab and go"
yad --width=400 --height=200 --title="Fun Facts" --timeout=30 --image $LOGO --text-align=center --skip-taskbar --image-on-top \
--wrap --no-buttons --center --window-icon=$LOGO --undecorated --text="<big><big><big><b>\r\rKM4ACK\rFun Facts</b></big></big></big>\r\r \
yad --width=400 --height=200 --title="Fun Facts" --timeout=30 --image ${LOGO} --text-align=center --skip-taskbar --image-on-top \
--wrap --no-buttons --center --window-icon=${LOGO} --undecorated --text="<big><big><big><b>\r\rKM4ACK\rFun Facts</b></big></big></big>\r\r \
The Yaesu 891 was the first HF rig he purchased new"
yad --width=400 --height=200 --title="Fun Facts" --timeout=30 --image $LOGO --text-align=center --skip-taskbar --image-on-top \
--wrap --no-buttons --center --window-icon=$LOGO --undecorated --text="<big><big><big><b>\r\rKM4ACK\rFun Facts</b></big></big></big>\r\r \
yad --width=400 --height=200 --title="Fun Facts" --timeout=30 --image ${LOGO} --text-align=center --skip-taskbar --image-on-top \
--wrap --no-buttons --center --window-icon=${LOGO} --undecorated --text="<big><big><big><b>\r\rKM4ACK\rFun Facts</b></big></big></big>\r\r \
He built a copper J-Pole as his first 2M 440 antenna"
yad --width=400 --height=200 --title="Fun Facts" --timeout=30 --image $LOGO --text-align=center --skip-taskbar --image-on-top \
--wrap --no-buttons --center --window-icon=$LOGO --undecorated --text="<big><big><big><b>\r\rKM4ACK\rFun Facts</b></big></big></big>\r\r \
yad --width=400 --height=200 --title="Fun Facts" --timeout=30 --image ${LOGO} --text-align=center --skip-taskbar --image-on-top \
--wrap --no-buttons --center --window-icon=${LOGO} --undecorated --text="<big><big><big><b>\r\rKM4ACK\rFun Facts</b></big></big></big>\r\r \
The J-Pole is still in use today"
yad --width=400 --height=200 --title="Fun Facts" --timeout=30 --image $LOGO --text-align=center --skip-taskbar --image-on-top \
--wrap --no-buttons --center --window-icon=$LOGO --undecorated --text="<big><big><big><b>\r\rKM4ACK\rFun Facts</b></big></big></big>\r\r \
yad --width=400 --height=200 --title="Fun Facts" --timeout=30 --image ${LOGO} --text-align=center --skip-taskbar --image-on-top \
--wrap --no-buttons --center --window-icon=${LOGO} --undecorated --text="<big><big><big><b>\r\rKM4ACK\rFun Facts</b></big></big></big>\r\r \
He has never had formal computer programming training"
yad --width=400 --height=200 --title="Fun Facts" --timeout=30 --image $LOGO --text-align=center --skip-taskbar --image-on-top \
--wrap --no-buttons --center --window-icon=$LOGO --undecorated --text="<big><big><big><b>\r\rKM4ACK\rFun Facts</b></big></big></big>\r\r \
yad --width=400 --height=200 --title="Fun Facts" --timeout=30 --image ${LOGO} --text-align=center --skip-taskbar --image-on-top \
--wrap --no-buttons --center --window-icon=${LOGO} --undecorated --text="<big><big><big><b>\r\rKM4ACK\rFun Facts</b></big></big></big>\r\r \
Yet continues his studies at <b>The School of Hard Knocks</b>"
yad --width=400 --height=200 --title="Fun Facts" --timeout=30 --image $LOGO --text-align=center --skip-taskbar --image-on-top \
--wrap --no-buttons --center --window-icon=$LOGO --undecorated --text="<big><big><big><b>\r\rKM4ACK\rFun Facts</b></big></big></big>\r\r \
He grew up in North Alabama. ROLL TIDE!!"
yad --width=400 --height=200 --title="Fun Facts" --timeout=30 --image ${LOGO} --text-align=center --skip-taskbar --image-on-top \
--wrap --no-buttons --center --window-icon=${LOGO} --undecorated --text="<big><big><big><b>\r\rKM4ACK\rFun Facts</b></big></big></big>\r\r \
He grew up in North Alabama. ROLL TIDE!!"
yad --width=400 --height=200 --title="Fun Facts" --timeout=30 --image $LOGO --text-align=center --skip-taskbar --image-on-top \
--wrap --no-buttons --center --window-icon=$LOGO --undecorated --text="<big><big><big><b>\r\rKM4ACK\rFun Facts</b></big></big></big>\r\r \
He moved to Tennessee after meeting his wife Pj"
yad --width=400 --height=200 --title="Fun Facts" --timeout=30 --image ${LOGO} --text-align=center --skip-taskbar --image-on-top \
--wrap --no-buttons --center --window-icon=${LOGO} --undecorated --text="<big><big><big><b>\r\rKM4ACK\rFun Facts</b></big></big></big>\r\r \
He moved to Tennessee after meeting his wife Pj"
yad --width=400 --height=200 --title="Fun Facts" --timeout=30 --image $LOGO --text-align=center --skip-taskbar --image-on-top \
--wrap --no-buttons --center --window-icon=$LOGO --undecorated --text="<big><big><big><b>\r\rKM4ACK\rFun Facts</b></big></big></big>\r\r \
yad --width=400 --height=200 --title="Fun Facts" --timeout=30 --image ${LOGO} --text-align=center --skip-taskbar --image-on-top \
--wrap --no-buttons --center --window-icon=${LOGO} --undecorated --text="<big><big><big><b>\r\rKM4ACK\rFun Facts</b></big></big></big>\r\r \
His first radio was a Baofeng that he purchased before he had a license"
yad --width=400 --height=200 --title="Fun Facts" --timeout=30 --image $LOGO --text-align=center --skip-taskbar --image-on-top \
--wrap --no-buttons --center --window-icon=$LOGO --undecorated --text="<big><big><big><b>\r\rKM4ACK\rFun Facts</b></big></big></big>\r\r \
yad --width=400 --height=200 --title="Fun Facts" --timeout=30 --image ${LOGO} --text-align=center --skip-taskbar --image-on-top \
--wrap --no-buttons --center --window-icon=${LOGO} --undecorated --text="<big><big><big><b>\r\rKM4ACK\rFun Facts</b></big></big></big>\r\r \
As of June 2020 he owns 9 Raspberry Pi's. All but 1 is in use."
yad --width=400 --height=200 --title="Fun Facts" --timeout=30 --image $LOGO --text-align=center --skip-taskbar --image-on-top \
--wrap --no-buttons --center --window-icon=$LOGO --undecorated --text="<big><big><big><b>\r\rKM4ACK\rFun Facts</b></big></big></big>\r\r \
yad --width=400 --height=200 --title="Fun Facts" --timeout=30 --image ${LOGO} --text-align=center --skip-taskbar --image-on-top \
--wrap --no-buttons --center --window-icon=${LOGO} --undecorated --text="<big><big><big><b>\r\rKM4ACK\rFun Facts</b></big></big></big>\r\r \
One pi runs a PBX server over AREDN serving roughly 40 hams VOIP phone service"
yad --width=400 --height=200 --title="Fun Facts" --timeout=30 --image $LOGO --text-align=center --skip-taskbar --image-on-top \
--wrap --no-buttons --center --window-icon=$LOGO --undecorated --text="<big><big><big><b>\r\rKM4ACK\rFun Facts</b></big></big></big>\r\r \
yad --width=400 --height=200 --title="Fun Facts" --timeout=30 --image ${LOGO} --text-align=center --skip-taskbar --image-on-top \
--wrap --no-buttons --center --window-icon=${LOGO} --undecorated --text="<big><big><big><b>\r\rKM4ACK\rFun Facts</b></big></big></big>\r\r \
Another pi runs an APRS digipeater"
yad --width=400 --height=200 --title="Fun Facts" --timeout=30 --image $LOGO --text-align=center --skip-taskbar --image-on-top \
--wrap --no-buttons --center --window-icon=$LOGO --undecorated --text="<big><big><big><b>\r\rKM4ACK\rFun Facts</b></big></big></big>\r\r \
yad --width=400 --height=200 --title="Fun Facts" --timeout=30 --image ${LOGO} --text-align=center --skip-taskbar --image-on-top \
--wrap --no-buttons --center --window-icon=${LOGO} --undecorated --text="<big><big><big><b>\r\rKM4ACK\rFun Facts</b></big></big></big>\r\r \
His favorite digital mode is JS8Call"
yad --width=400 --height=200 --title="Fun Facts" --timeout=30 --image $LOGO --text-align=center --skip-taskbar --image-on-top \
--wrap --no-buttons --center --window-icon=$LOGO --undecorated --text="<big><big><big><b>\r\rKM4ACK\rFun Facts</b></big></big></big>\r\r \
yad --width=400 --height=200 --title="Fun Facts" --timeout=30 --image ${LOGO} --text-align=center --skip-taskbar --image-on-top \
--wrap --no-buttons --center --window-icon=${LOGO} --undecorated --text="<big><big><big><b>\r\rKM4ACK\rFun Facts</b></big></big></big>\r\r \
He got interested in EMCOMM because he lost cell service after a tornado outbreak in his home town"
yad --width=400 --height=200 --title="Fun Facts" --timeout=30 --image $LOGO --text-align=center --skip-taskbar --image-on-top \
--wrap --no-buttons --center --window-icon=$LOGO --undecorated --text="<big><big><big><b>\r\rKM4ACK\rFun Facts</b></big></big></big>\r\r \
yad --width=400 --height=200 --title="Fun Facts" --timeout=30 --image ${LOGO} --text-align=center --skip-taskbar --image-on-top \
--wrap --no-buttons --center --window-icon=${LOGO} --undecorated --text="<big><big><big><b>\r\rKM4ACK\rFun Facts</b></big></big></big>\r\r \
He used Windows from 3.1 to WIN10. He now runs a Mac as his \
work machine and Raspberry Pi's for all things ham radio"
yad --width=400 --height=200 --title="Fun Facts" --timeout=30 --image $LOGO --text-align=center --skip-taskbar --image-on-top \
--wrap --no-buttons --center --window-icon=$LOGO --undecorated --text="<big><big><big><b>\r\rKM4ACK\rFun Facts</b></big></big></big>\r\r \
yad --width=400 --height=200 --title="Fun Facts" --timeout=30 --image ${LOGO} --text-align=center --skip-taskbar --image-on-top \
--wrap --no-buttons --center --window-icon=${LOGO} --undecorated --text="<big><big><big><b>\r\rKM4ACK\rFun Facts</b></big></big></big>\r\r \
Two of his favorite ham YouTubers are Ham Radio Crash Course and K8MRD Radio"
yad --width=400 --height=200 --title="Fun Facts" --timeout=30 --image $LOGO --text-align=center --skip-taskbar --image-on-top \
--wrap --no-buttons --center --window-icon=$LOGO --undecorated --text="<big><big><big><b>\r\rKM4ACK\rFun Facts</b></big></big></big>\r\r \
yad --width=400 --height=200 --title="Fun Facts" --timeout=30 --image ${LOGO} --text-align=center --skip-taskbar --image-on-top \
--wrap --no-buttons --center --window-icon=${LOGO} --undecorated --text="<big><big><big><b>\r\rKM4ACK\rFun Facts</b></big></big></big>\r\r \
His favorite non ham Youtuber is Wranglerstar"
yad --width=400 --height=200 --title="Fun Facts" --timeout=30 --image $LOGO --text-align=center --skip-taskbar --image-on-top \
--wrap --no-buttons --center --window-icon=$LOGO --undecorated --text="<big><big><big><b>\r\rKM4ACK\rFun Facts</b></big></big></big>\r\r \
yad --width=400 --height=200 --title="Fun Facts" --timeout=30 --image ${LOGO} --text-align=center --skip-taskbar --image-on-top \
--wrap --no-buttons --center --window-icon=${LOGO} --undecorated --text="<big><big><big><b>\r\rKM4ACK\rFun Facts</b></big></big></big>\r\r \
Enough about KM4ACK! Go grab a coffee or do something fun while your pi is built"

Wyświetl plik

@ -11,93 +11,93 @@
##################################################################
#20200620
DESK=$(printenv | grep DISPLAY)
MYPATH="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
LOGO=$MYPATH/logo.png
RB=$HOME/.config/KM4ACK
BASE=$MYPATH/base.txt
ADDITIONAL=$MYPATH/additional.txt
UTILITY=$MYPATH/utility.txt
FLSUITE=$MYPATH/flsuite.txt
CONFIG=$MYPATH/config
FUNCTIONS=$MYPATH/functions
TEMPCRON=$MYPATH/cron.tmp
DIR=$MYPATH/temp
MYPATH="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)"
LOGO=${MYPATH}/logo.png
RB=${HOME}/.config/KM4ACK
BASE=${MYPATH}/base.txt
ADDITIONAL=${MYPATH}/additional.txt
UTILITY=${MYPATH}/utility.txt
FLSUITE=${MYPATH}/flsuite.txt
CONFIG=${MYPATH}/config
FUNCTIONS=${MYPATH}/functions
TEMPCRON=${MYPATH}/cron.tmp
DIR=${MYPATH}/temp
WHO=$(whoami)
VERSION=$(grep "version=" $MYPATH/changelog | sed 's/version=//')
VERSION=$(grep "version=" ${MYPATH}/changelog | sed 's/version=//')
FINISH(){
if [ -f "$BASE" ]; then
rm $BASE
fi
FINISH() {
if [ -f "${BASE}" ]; then
rm ${BASE}
fi
if [ -f "$ADDITIONAL" ]; then
rm $ADDITIONAL
fi
if [ -f "${ADDITIONAL}" ]; then
rm ${ADDITIONAL}
fi
if [ -f "$FLSUITE" ]; then
rm $FLSUITE
fi
if [ -f "${FLSUITE}" ]; then
rm ${FLSUITE}
fi
if [ -f "$UTILITY" ]; then
rm $UTILITY
fi
if [ -f "${UTILITY}" ]; then
rm ${UTILITY}
fi
}
trap FINISH EXIT
#check for display. can't run from SSH
if [ -z "$DESK" ]
then
cat <<EOF
if [ -z "$DESK" ]; then
cat <<EOF
This script cannot be run from an SSH session.
Please boot into the pi's desktop environment,
open the terminal, and run this script again
EOF
exit 0
exit 0
fi
#install YAD & jq as needed
clear;echo;echo
clear
echo
echo
echo "#######################################"
echo "# Updating repository & installing #"
echo "# a few needed items before we begin #"
echo "#######################################"
sudo apt-get update
if ! hash yad 2>/dev/null; then
if ! hash yad 2>/dev/null; then
sudo apt install -y yad
fi
if ! hash jq 2>/dev/null; then
fi
if ! hash jq 2>/dev/null; then
sudo apt install -y jq
fi
if ! hash bc>/dev/null; then
fi
if ! hash bc >/dev/null; then
sudo apt install -y bc
fi
fi
#####################################
# Check if run before
#####################################
if [ -f "$RB" ]; then
bash $MYPATH/update &
exit
if [ -f "${RB}" ]; then
bash ${MYPATH}/update &
exit
fi
#####################################
# Check user is pi
#####################################
if [ "$WHO" != 'pi' ]; then
yad --form --width=500 --text-align=center --center --title="Build-a-Pi" --text-align=center \
--image $LOGO --window-icon=$LOGO --image-on-top --separator="|" --item-separator="|" \
--text="<b>USER NAME IS NOT PI</b>\rThis script is designed to be run as the pi user. Please set the user name to pi \
yad --form --width=500 --text-align=center --center --title="Build-a-Pi" --text-align=center \
--image ${LOGO} --window-icon=${LOGO} --image-on-top --separator="|" --item-separator="|" \
--text="<b>USER NAME IS NOT PI</b>\rThis script is designed to be run as the pi user. Please set the user name to pi \
and try again. You can change the user name after the build is complete but some configuration may not work \
as expected" \
--button=gtk-close
exit 1
--button=gtk-close
exit 1
fi
#####################################
# notice to user
#####################################
cat <<EOF > $MYPATH/intro.txt
cat <<EOF >${MYPATH}/intro.txt
This script takes approximately 4 hours to complete
if you choose to install everything. If you find it
helpful please consider a donation to encourage future
@ -106,343 +106,334 @@ development.
https://paypal.me/km4ack
EOF
INTRO=$(yad --width=550 --height=250 --text-align=center --center --title="Build-a-Pi" --show-uri \
--image $LOGO --window-icon=$LOGO --image-on-top --separator="|" --item-separator="|" \
--text-info<$MYPATH/intro.txt \
--button="Continue":2 > /dev/null 2>&1)
INTRO=$(yad --width=550 --height=250 --text-align=center --center --title="Build-a-Pi" --show-uri \
--image ${LOGO} --window-icon=${LOGO} --image-on-top --separator="|" --item-separator="|" \
--text-info \
--button="Continue":2 <${MYPATH}/intro.txt \
>/dev/null 2>&1)
BUT=$?
if [ $BUT = 252 ]; then
rm $MYPATH/intro.txt
exit
if [ ${BUT} = 252 ]; then
rm ${MYPATH}/intro.txt
exit
fi
rm $MYPATH/intro.txt
rm ${MYPATH}/intro.txt
#####################################
# Create autostart dir
#used to autostart conky at boot
#####################################
mkdir -p $HOME/.config/autostart
mkdir -p ${HOME}/.config/autostart
#####################################
# Get User Call
#####################################
CALL(){
INFO=$(yad --form --width=420 --text-align=center --center --title="Build-a-Pi" \
--image $LOGO --window-icon=$LOGO --image-on-top --separator="|" --item-separator="|" \
--text="<b>version $VERSION</b>" \
--field="Call Sign*" \
--field="<b>* Required</b>":LBL \
--button="Continue":2)
BUT=$?
if [ $BUT = 252 ]; then
exit
fi
CALL() {
INFO=$(yad --form --width=420 --text-align=center --center --title="Build-a-Pi" \
--image ${LOGO} --window-icon=${LOGO} --image-on-top --separator="|" --item-separator="|" \
--text="<b>version $VERSION</b>" \
--field="Call Sign*" \
--field="<b>* Required</b>":LBL \
--button="Continue":2)
BUT=$?
if [ ${BUT} = 252 ]; then
exit
fi
}
CALL
CALL=$(echo $INFO | awk -F "|" '{print $1}')
CALL=$(echo ${INFO} | awk -F "|" '{print $1}')
CALL=${CALL^^}
#Verify call not empty
ATTEMPTS=0
while [ -z "$CALL" ];
do
if [ $ATTEMPTS -eq 3 ]
then
while [ -z "$CALL" ]; do
if [ $ATTEMPTS -eq 3 ]; then
yad --form --width=420 --text-align=center --center --title="Build-a-Pi" --text-align=center \
--image $LOGO --window-icon=$LOGO --image-on-top --separator="|" --item-separator="|" \
--text="<b>Empty callsign after 3 attempts. Quiting!</b>" \
--button=gtk-ok
--image ${LOGO} --window-icon=${LOGO} --image-on-top --separator="|" --item-separator="|" \
--text="<b>Empty callsign after 3 attempts. Quiting!</b>" \
--button=gtk-ok
exit
fi
yad --form --width=420 --text-align=center --center --title="Build-a-Pi" --text-align=center \
--image $LOGO --window-icon=$LOGO --image-on-top --separator="|" --item-separator="|" \
--text="<b>Call Can't be Blank</b>" \
--button=gtk-ok
--image ${LOGO} --window-icon=${LOGO} --image-on-top --separator="|" --item-separator="|" \
--text="<b>Call Can't be Blank</b>" \
--button=gtk-ok
((ATTEMPTS=ATTEMPTS+1))
((ATTEMPTS = ATTEMPTS + 1))
CALL
CALL=$(echo $INFO | awk -F "|" '{print $1}')
CALL=$(echo ${INFO} | awk -F "|" '{print $1}')
CALL=${CALL^^}
done
echo "CALL=$CALL" > $CONFIG
echo "CALL=$CALL" >${CONFIG}
#####################################
# Base Apps
#####################################
yad --center --list --checklist --width=600 --height=600 --separator="" \
--image $LOGO --column=Check --column=App --column=Description \
--print-column=2 --window-icon=$LOGO --image-on-top --text-align=center \
--text="<b>Base Applications</b>" --title="Build-a-Pi" \
false "HOTSPOT" "Hot Spot Generator for Portable Ops" \
false "HSTOOLS" "Tools to Manage Hot Spot" \
false "GPS" "GPS Software" \
false "ARDOP" "Modem for HF" \
false "ARDOPGUI" "GUI for ARDOP" \
false "HAMLIB" "Needed for Rig Control" \
false "DIREWOLF" "Software TNC" \
false "AX25" "Data Link Layer Protocol" \
false "PULSE" "Pulse Audio Control Interface" \
--button="Exit":1 \
--button="Check All and Continue":3 \
--button="Next":2 > $BASE
--image ${LOGO} --column=Check --column=App --column=Description \
--print-column=2 --window-icon=${LOGO} --image-on-top --text-align=center \
--text="<b>Base Applications</b>" --title="Build-a-Pi" \
false "HOTSPOT" "Hot Spot Generator for Portable Ops" \
false "HSTOOLS" "Tools to Manage Hot Spot" \
false "GPS" "GPS Software" \
false "ARDOP" "Modem for HF" \
false "ARDOPGUI" "GUI for ARDOP" \
false "HAMLIB" "Needed for Rig Control" \
false "DIREWOLF" "Software TNC" \
false "AX25" "Data Link Layer Protocol" \
false "PULSE" "Pulse Audio Control Interface" \
--button="Exit":1 \
--button="Check All and Continue":3 \
--button="Next":2 >${BASE}
BUT=$?
if [ $BUT = 252 ] || [ $BUT = 1 ]; then
exit
if [ ${BUT} = 252 ] || [ ${BUT} = 1 ]; then
exit
fi
if [ $BUT = 3 ]; then
BASEAPPS=(HOTSPOT HSTOOLS GPS ARDOP ARDOPGUI HAMLIB DIREWOLF AX25 PULSE)
for i in "${BASEAPPS[@]}"
do
echo "$i" >> $BASE
done
if [ ${BUT} = 3 ]; then
BASEAPPS=(HOTSPOT HSTOOLS GPS ARDOP ARDOPGUI HAMLIB DIREWOLF AX25 PULSE)
for i in "${BASEAPPS[@]}"; do
echo "$i" >>${BASE}
done
fi
#check if hotspot is chosen for install & get info if needed
HS=$(grep "HOTSPOT" $BASE)
HS=$(grep "HOTSPOT" ${BASE})
if [ -n "$HS" ]; then
HSINFO(){
#unblock wifi
sudo rfkill unblock all > /dev/null 2>&1
#bring wifi up
sudo ifconfig wlan0 up
#LIST=$(sudo iw dev "wlan0" scan ap-force | egrep "^BSS|SSID:" | grep SSID: | sed 's/SSID://' | awk '{ print $1 }')
#LIST=$(echo $LIST | sed 's/ /|/g')
LIST=$(sudo iw dev "wlan0" scan ap-force | sed -ne 's/^.*SSID: \(..*\)/\1/p' | sort | uniq | paste -sd '|')
HSINFO() {
#unblock wifi
sudo rfkill unblock all >/dev/null 2>&1
#bring wifi up
sudo ifconfig wlan0 up
#LIST=$(sudo iw dev "wlan0" scan ap-force | egrep "^BSS|SSID:" | grep SSID: | sed 's/SSID://' | awk '{ print $1 }')
#LIST=$(echo $LIST | sed 's/ /|/g')
LIST=$(sudo iw dev "wlan0" scan ap-force | sed -ne 's/^.*SSID: \(..*\)/\1/p' | sort | uniq | paste -sd '|')
HSINFO=$(yad --center --form --width=400 --height=400 --separator="|" --item-separator="|" \
--image $LOGO --column=Check --column=App --column=Description \
--window-icon=$LOGO --image-on-top --text-align=center \
--text="<b>HotSpot Information\r\rPlease enter the information\rbelow \
HSINFO=$(yad --center --form --width=400 --height=400 --separator="|" --item-separator="|" \
--image ${LOGO} --column=Check --column=App --column=Description \
--window-icon=${LOGO} --image-on-top --text-align=center \
--text="<b>HotSpot Information\r\rPlease enter the information\rbelow \
for the Hot Spot\r</b>NOTE: The last field is the password for the hotspot. You will use this password to \
connect to your Pi when it is in hotspot mode <b>This password can only contain letters and numbers</b>" \
--title="Build-a-Pi" \
--field="Home Wifi SSID":CB "$LIST" \
--field="Home Wifi Password" \
--field="Hot Spot Password" \
--button="Exit":1 \
--button="Continue":2 \
--button="Refresh Wifi":3)
BUT=$?
if [ $BUT = 3 ];then
HSINFO #Call HSINFO function
fi
--title="Build-a-Pi" \
--field="Home Wifi SSID":CB "$LIST" \
--field="Home Wifi Password" \
--field="Hot Spot Password" \
--button="Exit":1 \
--button="Continue":2 \
--button="Refresh Wifi":3)
BUT=$?
if [ ${BUT} = 3 ]; then
HSINFO #Call HSINFO function
fi
if [ $BUT = 252 ] || [ $BUT = 1 ]; then
exit
fi
#}
#HSINFO
#fi
SHACKSSID=$(echo $HSINFO | awk -F "|" '{print $1}')
SHACKPASS=$(echo $HSINFO | awk -F "|" '{print $2}')
HSPASS=$(echo $HSINFO | awk -F "|" '{print $3}')
if [ ${BUT} = 252 ] || [ ${BUT} = 1 ]; then
exit
fi
#}
#HSINFO
#fi
SHACKSSID=$(echo $HSINFO | awk -F "|" '{print $1}')
SHACKPASS=$(echo $HSINFO | awk -F "|" '{print $2}')
HSPASS=$(echo $HSINFO | awk -F "|" '{print $3}')
#Check password length
if [ -n "$HS" ]; then
COUNT=${#HSPASS}
if [ $COUNT -lt 8 ]
then
yad --center --form --width=300 --height=200 --separator="|" \
--image $LOGO --window-icon=$LOGO --image-on-top --text-align=center \
--text="<b>Hotspot password has to be 8-63 characters</b>" --title="Build-a-Pi" \
--button=gtk-ok
#Check password length
if [ -n "$HS" ]; then
COUNT=${#HSPASS}
if [ ${COUNT} -lt 8 ]; then
yad --center --form --width=300 --height=200 --separator="|" \
--image ${LOGO} --window-icon=${LOGO} --image-on-top --text-align=center \
--text="<b>Hotspot password has to be 8-63 characters</b>" --title="Build-a-Pi" \
--button=gtk-ok
HSINFO
fi
fi
}
HSINFO
fi
fi
}
HSINFO
fi
echo "SHACKSSID=$SHACKSSID" >> $CONFIG
echo "SHACKPASS=\"$SHACKPASS\"" >> $CONFIG
echo "HSPASS=\"$HSPASS\"" >> $CONFIG
echo "SHACKSSID=$SHACKSSID" >>${CONFIG}
echo "SHACKPASS=\"$SHACKPASS\"" >>${CONFIG}
echo "HSPASS=\"$HSPASS\"" >>${CONFIG}
###################################
#CHECK IF GPS IS CHOSEN TO INSTALL#
###################################
GPSINSTALL=$(cat $BASE | grep GPS)
if [ -n "$GPSINSTALL" ]; then
GPSINSTALL=$(cat ${BASE} | grep GPS)
if [ -n "${GPS}INSTALL" ]; then
yad --center --height="300" --width="300" --form --separator="|" --item-separator="|" --title="GPS" \
--image ${LOGO} --window-icon=${LOGO} --image-on-top \
--text="\r\r\r\r\r<b><big>Connect your GPS to the pi</big></b>" \
--button="Exit":1 \
--button="Continue":2
yad --center --height="300" --width="300" --form --separator="|" --item-separator="|" --title="GPS" \
--image $LOGO --window-icon=$LOGO --image-on-top \
--text="\r\r\r\r\r<b><big>Connect your GPS to the pi</big></b>" \
--button="Exit":1 \
--button="Continue":2
BUT=$?
if [ ${BUT} = 1 ] || [ ${BUT} = 252 ]; then
exit
fi
USB=$(ls /dev/serial/by-id)
USB=$(echo $USB | sed "s/\s/|/g")
BUT=$?
if [ $BUT = 1 ] || [ $BUT = 252 ]; then
exit
fi
USB=$(ls /dev/serial/by-id)
USB=$(echo $USB | sed "s/\s/|/g")
GPS=$(yad --center --height="600" --width="300" --form --separator="|" --item-separator="|" --title="GPS" \
--image ${LOGO} --window-icon=${LOGO} --image-on-top \
--text="Choose Your GPS" \
--field="GPS":CB "$USB")
BUT=$?
if [ ${BUT} = 252 ] || [ ${BUT} = 1 ]; then
echo exiting
exit
fi
GPS=$(yad --center --height="600" --width="300" --form --separator="|" --item-separator="|" --title="GPS" \
--image $LOGO --window-icon=$LOGO --image-on-top \
--text="Choose Your GPS" \
--field="GPS":CB "$USB")
BUT=$?
if [ $BUT = 252 ] || [ $BUT = 1 ]; then
echo exiting
exit
fi
GPS=$(echo $GPS | awk -F "|" '{print $1}')
GPS=/dev/serial/by-id/$GPS
echo "GPS=$GPS" >> $CONFIG
GPS=$(echo ${GPS} | awk -F "|" '{print $1}')
GPS=/dev/serial/by-id/${GPS}
echo "GPS=${GPS}" >>${CONFIG}
fi
#####################################
# FLSUITE
#####################################
yad --center --list --checklist --width=600 --height=600 --separator="" \
--image $LOGO --column=Check --column=App --column=Description \
--print-column=2 --window-icon=$LOGO --image-on-top --text-align=center \
--text="<b>FLDIGI Suite</b>" --title="Build-a-Pi" \
false "FLRIG" "Rig Contol GUI" \
false "FLDIGI" "Digital Software" \
false "FLAMP" "File Transfer Program" \
false "FLNET" "Net Control Software" \
false "FLMSG" "Forms Manager" \
false "FLWRAP" "File Encapsulation" \
--button="Exit":1 \
--button="Check All and Continue":3 \
--button="Next":2 > $FLSUITE
--image ${LOGO} --column=Check --column=App --column=Description \
--print-column=2 --window-icon=${LOGO} --image-on-top --text-align=center \
--text="<b>FLDIGI Suite</b>" --title="Build-a-Pi" \
false "FLRIG" "Rig Contol GUI" \
false "FLDIGI" "Digital Software" \
false "FLAMP" "File Transfer Program" \
false "FLNET" "Net Control Software" \
false "FLMSG" "Forms Manager" \
false "FLWRAP" "File Encapsulation" \
--button="Exit":1 \
--button="Check All and Continue":3 \
--button="Next":2 >${FLSUITE}
BUT=$?
if [ $BUT = 252 ] || [ $BUT = 1 ]; then
exit
if [ ${BUT} = 252 ] || [ ${BUT} = 1 ]; then
exit
fi
if [ $BUT = 3 ]; then
FLAPPS=(FLRIG FLDIGI FLAMP FLNET FLMSG FLWRAP)
for i in "${FLAPPS[@]}"
do
echo "$i" >> $FLSUITE
done
if [ ${BUT} = 3 ]; then
FLAPPS=(FLRIG FLDIGI FLAMP FLNET FLMSG FLWRAP)
for i in "${FLAPPS[@]}"; do
echo "$i" >>${FLSUITE}
done
fi
#####################################
# Ham Apps
#####################################
yad --center --list --checklist --width=600 --height=600 --separator="" \
--image $LOGO --column=Check --column=App --column=Description \
--print-column=2 --window-icon=$LOGO --image-on-top --text-align=center \
--text="<b>Ham Applications</b>" --title="Build-a-Pi" \
false "CONKY" "System Information Display" \
false "PI-APRS" "APRS Message Application" \
false "CHIRP" "Program Radios" \
false "GARIM" "File Transfer Program" \
false "PAT" "Radio Email Application" \
false "PAT-MENU" "Control for Pat Winlink" \
false "JS8CALL" "Weak Signal Digital Mode Software" \
false "M0IAX" "Tools for JS8Call Messages" \
false "WSJTX" "Weak Signal Digital Mode Software" \
false "PYQSO" "Logging Software" \
false "CQRLOG" "Logging Software" \
false "XLOG" "Logging Software" \
false "EES" "KM4ACK Emergency Email Server" \
false "QSSTV" "Slow Scan TV" \
false "GRIDTRACKER" "Track Grids in WSJTX" \
false "HAMCLOCK" "Clock for Ham Radio Ops" \
false "PROPAGATION" "Propagation Prediction Software" \
false "YAAC" "Yet Another APRS Client" \
false "XASTIR" "APRS Client" \
false "GPREDICT" "Satellite Tracking" \
false "TQSL" "LOTW Software" \
--button="Exit":1 \
--button="Check All and Continue":3 \
--button="Next":2 > $ADDITIONAL
--image ${LOGO} --column=Check --column=App --column=Description \
--print-column=2 --window-icon=${LOGO} --image-on-top --text-align=center \
--text="<b>Ham Applications</b>" --title="Build-a-Pi" \
false "CONKY" "System Information Display" \
false "PI-APRS" "APRS Message Application" \
false "CHIRP" "Program Radios" \
false "GARIM" "File Transfer Program" \
false "PAT" "Radio Email Application" \
false "PAT-MENU" "Control for Pat Winlink" \
false "JS8CALL" "Weak Signal Digital Mode Software" \
false "M0IAX" "Tools for JS8Call Messages" \
false "WSJTX" "Weak Signal Digital Mode Software" \
false "PYQSO" "Logging Software" \
false "CQRLOG" "Logging Software" \
false "XLOG" "Logging Software" \
false "EES" "KM4ACK Emergency Email Server" \
false "QSSTV" "Slow Scan TV" \
false "GRIDTRACKER" "Track Grids in WSJTX" \
false "HAMCLOCK" "Clock for Ham Radio Ops" \
false "PROPAGATION" "Propagation Prediction Software" \
false "YAAC" "Yet Another APRS Client" \
false "XASTIR" "APRS Client" \
false "GPREDICT" "Satellite Tracking" \
false "TQSL" "LOTW Software" \
--button="Exit":1 \
--button="Check All and Continue":3 \
--button="Next":2 >${ADDITIONAL}
BUT=$?
if [ $BUT = 252 ] || [ $BUT = 1 ]; then
exit
if [ ${BUT} = 252 ] || [ ${BUT} = 1 ]; then
exit
fi
if [ $BUT = 3 ]; then
ADDAPPS=(CONKY PI-APRS CHIRP GARIM PAT PAT-MENU JS8CALL M0IAX WSJTX PYQSO \
CQRLOG EES QSSTV GRIDTRACKER HAMCLOCK PROPAGATION YAAC XASTIR GPREDICT TQSL \
XLOG)
if [ ${BUT} = 3 ]; then
ADDAPPS=(CONKY PI-APRS CHIRP GARIM PAT PAT-MENU JS8CALL M0IAX WSJTX PYQSO
CQRLOG EES QSSTV GRIDTRACKER HAMCLOCK PROPAGATION YAAC XASTIR GPREDICT TQSL
XLOG)
for i in "${ADDAPPS[@]}"
do
echo "$i" >> $ADDITIONAL
done
for i in "${ADDAPPS[@]}"; do
echo "$i" >>${ADDITIONAL}
done
fi
#check if hamclock is being installed
HCCHECK=$(grep "HAMCLOCK" $ADDITIONAL)
HCCHECK=$(grep "HAMCLOCK" ${ADDITIONAL})
if [ -n "$HCCHECK" ]; then
HC=$(yad --form --width=420 --text-align=center --center --title="Build-a-Pi" \
--image $LOGO --window-icon=$LOGO --image-on-top --separator="|" --item-separator="|" \
--text="<b>version $VERSION</b>" \
--field="Ham Clock Size":CB "SMALL|LARGE" \
--button="Continue":2)
HC=$(echo $HC | awk -F "|" '{print $1}')
sed -i 's/HAMCLOCK//' $ADDITIONAL
echo $HC >> $ADDITIONAL
HC=$(yad --form --width=420 --text-align=center --center --title="Build-a-Pi" \
--image ${LOGO} --window-icon=${LOGO} --image-on-top --separator="|" --item-separator="|" \
--text="<b>version $VERSION</b>" \
--field="Ham Clock Size":CB "SMALL|LARGE" \
--button="Continue":2)
HC=$(echo $HC | awk -F "|" '{print $1}')
sed -i 's/HAMCLOCK//' ${ADDITIONAL}
echo $HC >>${ADDITIONAL}
fi
PATCHECK=$(grep "PAT" $ADDITIONAL)
PATCHECK=$(grep "PAT" ${ADDITIONAL})
if [ -n "$PATCHECK" ]; then
INFO=$(yad --form --width=420 --text-align=center --center --title="Build-a-Pi" \
--image $LOGO --window-icon=$LOGO --image-on-top --separator="|" --item-separator="|" \
--text="<b>version $VERSION</b>" \
--field="Six Character Grid Square" \
--field="Winlink Password" \
--field="<b>Password is case sensitive</b>":LBL \
--button="Continue":2)
GRID=$(echo $INFO | awk -F "|" '{print $1}')
GRID=${GRID^^}
WL2KPASS=$(echo $INFO | awk -F "|" '{print $2}')
echo "GRID=$GRID" >> $CONFIG
echo "WL2KPASS=\"$WL2KPASS\"" >> $CONFIG
INFO=$(yad --form --width=420 --text-align=center --center --title="Build-a-Pi" \
--image ${LOGO} --window-icon=${LOGO} --image-on-top --separator="|" --item-separator="|" \
--text="<b>version $VERSION</b>" \
--field="Six Character Grid Square" \
--field="Winlink Password" \
--field="<b>Password is case sensitive</b>":LBL \
--button="Continue":2)
GRID=$(echo ${INFO} | awk -F "|" '{print $1}')
GRID=${GRID^^}
WL2KPASS=$(echo ${INFO} | awk -F "|" '{print $2}')
echo "GRID=$GRID" >>${CONFIG}
echo "WL2KPASS=\"$WL2KPASS\"" >>${CONFIG}
fi
#####################################
# Utilities
#####################################
yad --center --list --checklist --width=600 --height=600 --separator="" \
--image $LOGO --column=Check --column=App --column=Description \
--print-column=2 --window-icon=$LOGO --image-on-top --text-align=center \
--text="<b>Utilities</b>" --title="Build-a-Pi" \
false "DIPOLE" "Dipole Calculator" \
false "CALLSIGN" "Call sign lookup" \
false "TEMPCONVERT" "Temperature Converter" \
false "GPARTED" "Disk Utility Tool" \
false "SHOWLOG" "Log file viewer" \
false "PISTATS" "Pi3/4 Stats Monitor" \
false "TELNET" "Telnet Protocol" \
false "PITERM" "piQtTermTCP Terminal Program" \
false "SECURITY" "File Encryption Software" \
false "YGATE" "Yaesu APRS Software" \
false "BPQ" "LinBPQ Software" \
false "BATT" "Battery Test Script" \
false "VNC" "VNC Client Application" \
false "ZYGRIB" "Grib File Viewer" \
false "GPSUPDATE" "Tool to Manage GPS Devices" \
--button="Exit":1 \
--button="Check All and Continue":3 \
--button="Install Selected":2 > $UTILITY
--image ${LOGO} --column=Check --column=App --column=Description \
--print-column=2 --window-icon=${LOGO} --image-on-top --text-align=center \
--text="<b>Utilities</b>" --title="Build-a-Pi" \
false "DIPOLE" "Dipole Calculator" \
false "CALLSIGN" "Call sign lookup" \
false "TEMPCONVERT" "Temperature Converter" \
false "GPARTED" "Disk Utility Tool" \
false "SHOWLOG" "Log file viewer" \
false "PISTATS" "Pi3/4 Stats Monitor" \
false "TELNET" "Telnet Protocol" \
false "PITERM" "piQtTermTCP Terminal Program" \
false "SECURITY" "File Encryption Software" \
false "YGATE" "Yaesu APRS Software" \
false "BPQ" "LinBPQ Software" \
false "BATT" "Battery Test Script" \
false "VNC" "VNC Client Application" \
false "ZYGRIB" "Grib File Viewer" \
false "GPSUPDATE" "Tool to Manage GPS Devices" \
--button="Exit":1 \
--button="Check All and Continue":3 \
--button="Install Selected":2 >${UTILITY}
BUT=$?
if [ $BUT = 252 ] || [ $BUT = 1 ]; then
exit
if [ ${BUT} = 252 ] || [ ${BUT} = 1 ]; then
exit
fi
if [ $BUT = 3 ]; then
UTILAPPS=(DIPOLE CALLSIGN TEMPCONVERT GPARTED SHOWLOG PISTATS TELNET PITERM SECURITY YGATE BPQ BATT VNC ZYGRIB GPSUPDATE)
for i in "${UTILAPPS[@]}"
do
echo "$i" >> $UTILITY
done
if [ ${BUT} = 3 ]; then
UTILAPPS=(DIPOLE CALLSIGN TEMPCONVERT GPARTED SHOWLOG PISTATS TELNET PITERM SECURITY YGATE BPQ BATT VNC ZYGRIB GPSUPDATE)
for i in "${UTILAPPS[@]}"; do
echo "$i" >>${UTILITY}
done
fi
#backup crontab
crontab -l > $TEMPCRON
echo "@reboot sleep 10 && export DISPLAY=:0 && $MYPATH/.complete" >> $TEMPCRON
$MYPATH/.funfacts &
#backup crontab
crontab -l >$TEMPCRON
echo "@reboot sleep 10 && export DISPLAY=:0 && ${MYPATH}/.complete" >>$TEMPCRON
${MYPATH}/.funfacts &
#upgrade the system
sudo apt-get -y upgrade
sudo apt -y full-upgrade
@ -452,11 +443,11 @@ sudo apt -y full-upgrade
sudo cp bap-wallpaper.jpg /usr/share/rpd-wallpaper/
pcmanfm --set-wallpaper /usr/share/rpd-wallpaper/bap-wallpaper.jpg
mkdir -p $DIR 2> /dev/null
mkdir -p ${DIR} 2>/dev/null
#add virtual sound card link for pulse audio
cd $DIR
cat > tempsound <<EOF
cd ${DIR} || exit
cat >tempsound <<EOF
pcm.pulse {
type pulse
}
@ -467,15 +458,14 @@ EOF
sudo chown root:root tempsound
sudo mv tempsound /etc/asound.conf
#mod sound card for Buster May 2020
#mod sound card for Buster May 2020
#so it will always load as card #2
cd $DIR
cat > tempsound <<EOF
cd ${DIR} || exit
cat >tempsound <<EOF
#Internal sound
options snd-bcm2835 index=0
options snd-bcm2835 index=0
#USB soundcard
#USB soundcard
options snd-usb-audio index=2
EOF
sudo chown root:root tempsound
@ -485,21 +475,21 @@ sudo mv tempsound /etc/modprobe.d/alsa.conf
sudo apt-get install -y extra-xdg-menus
#setup bin dir and put in path
mkdir -p $HOME/bin
echo "export PATH=$PATH:$HOME/bin" >> $HOME/.bashrc
mkdir -p ${HOME}/bin
echo "export PATH=$PATH:${HOME}/bin" >>${HOME}/.bashrc
#set update script to exec
chmod +x $MYPATH/update $MYPATH/build-a-pi
chmod +x ${MYPATH}/update ${MYPATH}/build-a-pi
#create build-a-pi menu item
cd $MYPATH
cat > build-a-pi.desktop <<EOF
cd ${MYPATH} || exit
cat >build-a-pi.desktop <<EOF
[Desktop Entry]
Name=Build-a-Pi
GenericName=KM4ACK Build-a-Pi
Comment=Build-a-Pi App Manager
Exec=$MYPATH/update
Icon=$MYPATH/logo.png
Exec=${MYPATH}/update
Icon=${MYPATH}/logo.png
Terminal=true
Type=Application
Categories=Settings;DesktopSettings;GTK;X-LXDE-Settings;
@ -510,82 +500,73 @@ sudo mv build-a-pi.desktop /usr/share/applications/
#####################################
# Install Base Apps
#####################################
touch $RB
source $FUNCTIONS/base.function
while read i ; do
$i
done < $BASE
touch ${RB}
source ${FUNCTIONS}/base.function
while read i; do
$i
done <${BASE}
#####################################
# Install FLSUITE
#####################################
source $FUNCTIONS/flsuite.function
source ${FUNCTIONS}/flsuite.function
#perform memory increase if needed
CHECKFL="$MYPATH/flsuite.txt"
CHECKFL="${MYPATH}/flsuite.txt"
if [ -s "$CHECKFL" ]; then
FLSTART
FLSTART
fi
touch $RB
while read i ; do
$i
done < $FLSUITE
touch ${RB}
while read i; do
$i
done <${FLSUITE}
#Perform memory reset if needed
if [ -s "$CHECKFL" ]; then
FLSTOP
FLSTOP
fi
#####################################
# Install ADDITIONAL Apps
#####################################
source $FUNCTIONS/additional.function
while read i ; do
$i
done < $ADDITIONAL
source ${FUNCTIONS}/additional.function
while read i; do
$i
done <${ADDITIONAL}
#####################################
# Install KM4ACK Utilites
#####################################
source $FUNCTIONS/utility.function
while read i ; do
$i
done < $UTILITY
source ${FUNCTIONS}/utility.function
while read i; do
$i
done <${UTILITY}
#####################################
# END CLEANUP
#####################################
#Remove temp files
rm $BASE $ADDITIONAL $UTILITY $FLSUITE > /dev/null 2>&1
rm -rf $DIR > /dev/null 2>&1
rm ${BASE} ${ADDITIONAL} ${UTILITY} ${FLSUITE} >/dev/null 2>&1
rm -rf ${DIR} >/dev/null 2>&1
#sudo apt -y autoremove > /dev/null 2>&1
#restore crontab
crontab $TEMPCRON
rm $TEMPCRON
crontab ${TEMPCRON}
rm ${TEMPCRON}
echo "WE ARE ALL DONE HERE. If you close this window, you will have to reboot manually."
#reboot when done
yad --width=400 --height=200 --title="Reboot" --image $LOGO \
--text-align=center --skip-taskbar --image-on-top \
--wrap --window-icon=$LOGO \
--undecorated --text="<big><big><big><b>Build Finished \rReboot Required</b></big></big></big>\r\r" \
--button="Reboot Now":0 \
--button="Exit":1
yad --width=400 --height=200 --title="Reboot" --image ${LOGO} \
--text-align=center --skip-taskbar --image-on-top \
--wrap --window-icon=${LOGO} \
--undecorated --text="<big><big><big><b>Build Finished \rReboot Required</b></big></big></big>\r\r" \
--button="Reboot Now":0 \
--button="Exit":1
BUT=$(echo $?)
if [ $BUT = 0 ]; then
echo rebooting
sudo reboot
elif [ $BUT = 1 ]; then
exit
if [ ${BUT} = 0 ]; then
echo rebooting
sudo reboot
elif [ ${BUT} = 1 ]; then
exit
fi

Wyświetl plik

@ -4,240 +4,236 @@
#to help diagnose issues
#20200616 km4ack
#11FEB2021 review km4ack
clear;echo;echo
read -p "What is your call sign? " CALL
DIR=$HOME/Desktop/$CALL-diagnostic-report
clear
echo
echo
read -rp "What is your call sign? " CALL
DIR=${HOME}/Desktop/${CALL}-diagnostic-report
#create temp dir
mkdir -p $DIR
mkdir -p ${DIR}
#check to see which apps are installed
CHECK(){
#----------------------------------------------------#
# Hotspot
#----------------------------------------------------#
HOTSPOT="/usr/bin/autohotspotN"
if [ ! -f "$HOTSPOT" ]; then
HOTSPOT="Not Installed"
else
HOTSPOT="Installed"
fi
#----------------------------------------------------#
# AX25
#----------------------------------------------------#
if [ ! -d /etc/ax25 ]; then
AX25="Not Installed"
else
AX25="Installed"
fi
#----------------------------------------------------#
# GPS
#----------------------------------------------------#
if ! hash gpsd 2>/dev/null; then
GPS="Not Installed"
else
GPS="Installed"
fi
#----------------------------------------------------#
# PULSE
#----------------------------------------------------#
if ! hash pulseaudio 2>/dev/null; then
PULSE="Not Installed"
else
PULSE="Installed"
fi
#----------------------------------------------------#
# ARDOP
#----------------------------------------------------#
if [ -f $HOME/ardop/piardopc ]; then
ARDOP="Installed"
else
ARDOP="Not Installed"
fi
#----------------------------------------------------#
# ARDOP GUI
#----------------------------------------------------#
if [ -f $HOME/ardop/piARDOP_GUI ]; then
ARDOPGUI="Installed"
else
ARDOPGUI="Not Installed"
fi
#----------------------------------------------------#
# RIG CONTROL - HAMLIB
#----------------------------------------------------#
if ! hash rigctl 2>/dev/null; then
RIG="Not_Installed"
else
echo "Checking Rig Control"
RIG=$(rigctl --version | grep Hamlib | sed s/"rigctl(d),\ Hamlib\ "//)
NEWRIG=$(curl -s https://sourceforge.net/projects/hamlib/files/latest/download | \
grep -o https://downloads.sourceforge.net/project/hamlib/hamlib/[0-9].[0-9] | \
head -n 1 | awk -F "/" '{print $7}')
if (( $(echo "$NEWRIG $RIG" | awk '{print ($1 > $2)}') ))
then
RIG=NEEDS-UPDATE
CHECK() {
#----------------------------------------------------#
# Hotspot
#----------------------------------------------------#
HOTSPOT="/usr/bin/autohotspotN"
if [ ! -f "${HOTSPOT}" ]; then
HOTSPOT="Not Installed"
else
RIG="is_latest_version"
HOTSPOT="Installed"
fi
fi
#----------------------------------------------------#
# FLRIG
#----------------------------------------------------#
echo "Checking FLRIG"
if ! hash flrig 2>/dev/null; then
FLRIG="Not_Installed"
else
FLRIG=$(flrig --version | awk 'FNR == 1 {print $2}')
NEWFLRIG=$(curl -s https://sourceforge.net/projects/fldigi/files/flrig/ | \
grep .tar.gz | head -1 | awk -F "-" '{print $2}' | awk -F ".tar.gz" '{print $1}')
if (( $(echo "$NEWFLRIG $FLRIG" | awk '{print ($1 > $2)}') ))
then
FLRIG=NEEDS-UPDATE
#----------------------------------------------------#
# AX25
#----------------------------------------------------#
if [ ! -d /etc/ax25 ]; then
AX25="Not Installed"
else
FLRIG="is_latest_version"
AX25="Installed"
fi
fi
#----------------------------------------------------#
# Pat Winlink
#----------------------------------------------------#
echo "Checking Pat Winlink"
if ! hash pat 2>/dev/null; then
PAT="Not_Installed"
else
PAT=$(pat version | awk -F 'v' '{print $2}' | head -c 5)
NEWPAT=$(curl -s https://github.com/la5nta/pat/releases | grep -m 1 "amd64.deb"\
| awk -F '_' '{print $2}')
if (( $(echo "$NEWPAT $PAT" | awk '{print ($1 > $2)}') ))
then
PAT=NEEDS-UPDATE
#----------------------------------------------------#
# GPS
#----------------------------------------------------#
if ! hash gpsd 2>/dev/null; then
GPS="Not Installed"
else
PAT="is_latest_version"
fi
fi
#----------------------------------------------------#
# DIREWOLF
#----------------------------------------------------#
echo "Checking Direwolf"
if ! hash direwolf 2>/dev/null; then
DIRE="Not_Installed"
else
DIRE=$(direwolf -S -t 0 | head -1 | sed 's/Dire\ Wolf\ version\ //')
wget -P /tmp/ https://raw.githubusercontent.com/wb2osz/direwolf/master/CHANGES.md > /dev/null 2>&1
NEWDIRE=$(cat /tmp/CHANGES.md | head -5 | tail -1 | awk '{ print $3 }')
if (( $(echo "$NEWDIRE $DIRE" | awk '{print ($1 > $2)}') ))
then
DIRE=NEEDS-UPDATE
else
DIRE="is_latest_version"
GPS="Installed"
fi
fi
#----------------------------------------------------#
# Pat Menu
#----------------------------------------------------#
echo "Checking Pat Menu"
if [ ! -d $HOME/patmenu2 ]; then
PATMENU="Not_Installed"
else
cd $HOME/patmenu2/
wget -O $HOME/patmenu2/latest https://raw.githubusercontent.com/km4ack/patmenu2/master/changelog > /dev/null 2>&1
LATEST=$(cat $HOME/patmenu2/latest | grep '^release' | sed 's/release=//')
CURRENT=$(cat $HOME/patmenu2/changelog | grep '^release' | sed 's/release=//')
rm $HOME/patmenu2/latest > /dev/null 2>&1
if (( $(echo "$LATEST $CURRENT" | awk '{print ($1 > $2)}') ))
then
PATMENU="NEEDS-UPDATE"
#----------------------------------------------------#
# PULSE
#----------------------------------------------------#
if ! hash pulseaudio 2>/dev/null; then
PULSE="Not Installed"
else
PATMENU="is_latest_version"
PULSE="Installed"
fi
fi
#----------------------------------------------------#
# Hot Spot Tools
#----------------------------------------------------#
if [ ! -d $HOME/hotspot-tools2 ]; then
HSTOOLS="Not_Installed"
else
CURRENT=$(cat $HOME/hotspot-tools2/changelog | grep version= | sed 's/version=//')
LATEST=$(curl -s https://raw.githubusercontent.com/km4ack/hotspot-tools2/master/changelog | grep version= | sed 's/version=//')
if (( $(echo "$LATEST $CURRENT" | awk '{print ($1 > $2)}') ))
then
HSTOOLS="NEEDS-UPDATE"
#----------------------------------------------------#
# ARDOP
#----------------------------------------------------#
if [ -f ${HOME}/ardop/piardopc ]; then
ARDOP="Installed"
else
HSTOOLS="is_latest_version"
ARDOP="Not Installed"
fi
#----------------------------------------------------#
# ARDOP GUI
#----------------------------------------------------#
if [ -f ${HOME}/ardop/piARDOP_GUI ]; then
ARDOPGUI="Installed"
else
ARDOPGUI="Not Installed"
fi
fi
#----------------------------------------------------#
# EES
#----------------------------------------------------#
if [ -f /var/www/html/email.php ]; then
EES="Installed"
else
EES="Not Installed"
fi
#----------------------------------------------------#
# RIG CONTROL - HAMLIB
#----------------------------------------------------#
if ! hash rigctl 2>/dev/null; then
RIG="Not_Installed"
else
echo "Checking Rig Control"
RIG=$(rigctl --version | grep Hamlib | sed s/"rigctl(d),\ Hamlib\ "//)
NEWRIG=$(curl -s https://sourceforge.net/projects/hamlib/files/latest/download |
grep -o https://downloads.sourceforge.net/project/hamlib/hamlib/[0-9].[0-9] |
head -n 1 | awk -F "/" '{print $7}')
#----------------------------------------------------#
# CONKY
#----------------------------------------------------#
if [ -f $HOME/.conkyrc ]; then
CONKY=Installed
else
CONKY="Not Installed"
fi
if (($(echo "${NEWRIG} ${RIG}" | awk '{print ($1 > $2)}'))); then
RIG=NEEDS-UPDATE
else
RIG="is_latest_version"
fi
fi
#----------------------------------------------------#
# FLRIG
#----------------------------------------------------#
echo "Checking FLRIG"
if ! hash flrig 2>/dev/null; then
FLRIG="Not_Installed"
else
FLRIG=$(flrig --version | awk 'FNR == 1 {print $2}')
NEWFLRIG=$(curl -s https://sourceforge.net/projects/fldigi/files/flrig/ |
grep .tar.gz | head -1 | awk -F "-" '{print $2}' | awk -F ".tar.gz" '{print $1}')
if (($(echo "${NEWFLRIG} ${FLRIG}" | awk '{print ($1 > $2)}'))); then
FLRIG=NEEDS-UPDATE
else
FLRIG="is_latest_version"
fi
fi
#----------------------------------------------------#
# Pat Winlink
#----------------------------------------------------#
echo "Checking Pat Winlink"
if ! hash pat 2>/dev/null; then
PAT="Not_Installed"
else
PAT=$(pat version | awk -F 'v' '{print $2}' | head -c 5)
NEWPAT=$(curl -s https://github.com/la5nta/pat/releases | grep -m 1 "amd64.deb" |
awk -F '_' '{print $2}')
if (($(echo "${NEWPAT} ${PAT}" | awk '{print ($1 > $2)}'))); then
PAT=NEEDS-UPDATE
else
PAT="is_latest_version"
fi
fi
#----------------------------------------------------#
# DIREWOLF
#----------------------------------------------------#
echo "Checking Direwolf"
if ! hash direwolf 2>/dev/null; then
DIRE="Not_Installed"
else
DIRE=$(direwolf -S -t 0 | head -1 | sed 's/Dire\ Wolf\ version\ //')
wget -P /tmp/ https://raw.githubusercontent.com/wb2osz/direwolf/master/CHANGES.md >/dev/null 2>&1
NEWDIRE=$(cat /tmp/CHANGES.md | head -5 | tail -1 | awk '{ print $3 }')
if (($(echo "${NEWDIRE} ${DIRE}" | awk '{print ($1 > $2)}'))); then
DIRE=NEEDS-UPDATE
else
DIRE="is_latest_version"
fi
fi
#----------------------------------------------------#
# Pat Menu
#----------------------------------------------------#
echo "Checking Pat Menu"
if [ ! -d ${HOME}/patmenu2 ]; then
PATMENU="Not_Installed"
else
cd ${HOME}/patmenu2/ || exit
wget -O ${HOME}/patmenu2/latest https://raw.githubusercontent.com/km4ack/patmenu2/master/changelog >/dev/null 2>&1
LATEST=$(cat ${HOME}/patmenu2/latest | grep '^release' | sed 's/release=//')
CURRENT=$(cat ${HOME}/patmenu2/changelog | grep '^release' | sed 's/release=//')
rm ${HOME}/patmenu2/latest >/dev/null 2>&1
if (($(echo "${LATEST} ${CURRENT}" | awk '{print ($1 > $2)}'))); then
PATMENU="NEEDS-UPDATE"
else
PATMENU="is_latest_version"
fi
fi
#----------------------------------------------------#
# Hot Spot Tools
#----------------------------------------------------#
if [ ! -d ${HOME}/hotspot-tools2 ]; then
HSTOOLS="Not_Installed"
else
CURRENT=$(cat ${HOME}/hotspot-tools2/changelog | grep version= | sed 's/version=//')
LATEST=$(curl -s https://raw.githubusercontent.com/km4ack/hotspot-tools2/master/changelog | grep version= | sed 's/version=//')
if (($(echo "${LATEST} ${CURRENT}" | awk '{print ($1 > $2)}'))); then
HSTOOLS="NEEDS-UPDATE"
else
HSTOOLS="is_latest_version"
fi
fi
#----------------------------------------------------#
# EES
#----------------------------------------------------#
if [ -f /var/www/html/email.php ]; then
EES="Installed"
else
EES="Not Installed"
fi
#----------------------------------------------------#
# CONKY
#----------------------------------------------------#
if [ -f ${HOME}/.conkyrc ]; then
CONKY=Installed
else
CONKY="Not Installed"
fi
}
CHECK
#get system info
WHO=$(whoami)
KERNAL=$(uname -r)
echo "User Name is $WHO" > $DIR/systeminfo.txt
echo "" >> $DIR/systeminfo.txt
echo "Kernal version is $KERNAL" >> $DIR/systeminfo.txt
echo "" >> $DIR/systeminfo.txt
cat /etc/os-release >> $DIR/systeminfo.txt
echo;echo;echo "#####uname######" >> $DIR/systeminfo.txt
uname -a >> $DIR/systeminfo.txt
echo "User Name is ${WHO}" >${DIR}/systeminfo.txt
echo "" >>${DIR}/systeminfo.txt
echo "Kernal version is ${KERNAL}" >>${DIR}/systeminfo.txt
echo "" >>${DIR}/systeminfo.txt
cat /etc/os-release >>${DIR}/systeminfo.txt
echo
echo
echo "#####uname######" >>${DIR}/systeminfo.txt
uname -a >>${DIR}/systeminfo.txt
#get direwolf.conf file
cat $HOME/direwolf.conf > $DIR/direwolf.conf
cat ${HOME}/direwolf.conf >${DIR}/direwolf.conf
#get pat config file
cat $HOME/.wl2k/config.json > $DIR/patconfig.txt
cat ${HOME}/.wl2k/config.json >${DIR}/patconfig.txt
#remove winlink password
sed -i 's/"secure_login_password":.*$/PASSWORD-REMOVED-FOR-YOUR-SECURITY/' $DIR/patconfig.txt
sed -i 's/"secure_login_password":.*$/PASSWORD-REMOVED-FOR-YOUR-SECURITY/' ${DIR}/patconfig.txt
#get pat menu config file
cat $HOME/patmenu2/config > $DIR/patmenu.conf
cat ${HOME}/patmenu2/config >${DIR}/patmenu.conf
#Get wpa_supplicant
sudo cat /etc/wpa_supplicant/wpa_supplicant.conf > $DIR/wpa.txt
sed -i 's/psk=.*$/PASSWORD-REMOVED/' $DIR/wpa.txt
sudo cat /etc/wpa_supplicant/wpa_supplicant.conf >${DIR}/wpa.txt
sed -i 's/psk=.*$/PASSWORD-REMOVED/' ${DIR}/wpa.txt
#get sound info
echo "" >> $DIR/sound.info
echo "ARECORD INFO" > $DIR/sound.info
arecord -l >> $DIR/sound.info
echo "" >> $DIR/sound.info
echo "" >> $DIR/sound.info
echo "APLAY INFO" >> $DIR/sound.info
aplay -l >> $DIR/sound.info
echo "" >> $DIR/sound.info
echo "" >> $DIR/sound.info
echo "Using sound card" >> $DIR/sound.info
sudo lsof /dev/snd/* >> $DIR/sound.info
echo "" >>${DIR}/sound.info
echo "ARECORD INFO" >${DIR}/sound.info
arecord -l >>${DIR}/sound.info
echo "" >>${DIR}/sound.info
echo "" >>${DIR}/sound.info
echo "APLAY INFO" >>${DIR}/sound.info
aplay -l >>${DIR}/sound.info
echo "" >>${DIR}/sound.info
echo "" >>${DIR}/sound.info
echo "Using sound card" >>${DIR}/sound.info
sudo lsof /dev/snd/* >>${DIR}/sound.info
#Get hotspot info
HS=$(systemctl is-active autohotspot)
@ -250,64 +246,70 @@ CIP=$(ifconfig | grep -A 1 wlan0 | grep inet | awk '{ print $2 }')
CHECK=$(ls /etc/wpa_supplicant/ | grep FORCE)
AUTORUN=$(crontab -l | grep autohotspotN | awk '{print $1}' | sed 's/*\///')
if [ -z "$CHECK" ]; then
FORCE="Hotspot Not in force mode"
FORCE="Hotspot Not in force mode"
else
FORCE="Hotspot IS in force mode"
FORCE="Hotspot IS in force mode"
fi
if [ $HSS = $CIP ]
then
HSS=ACTIVE
if [ ${HSS} = ${CIP} ]; then
HSS=ACTIVE
else
HSS=INACTIVE
HSS=INACTIVE
fi
FILE=$DIR/hotspot.info
FILE=${DIR}/hotspot.info
echo "Hotspot status $HS" > $FILE
echo "Hotspot state $HSS" >> $FILE
echo "Hotspot Name is $CURRENTNAME" >> $FILE
echo "Hotspot IP = $HSIP" >> $FILE
echo "Wireless IP = $CIP" >> $FILE
echo "CAT5 IP = $WIREIP" >> $FILE
echo "$FORCE" >> $FILE
echo "crontab set to auto run ever $AUTORUN minutes" >> $FILE
echo "Hotspot status ${HS}" >${FILE}
echo "Hotspot state ${HSS}" >>${FILE}
echo "Hotspot Name is ${CURRENTNAME}" >>${FILE}
echo "Hotspot IP = ${HSIP}" >>${FILE}
echo "Wireless IP = ${CIP}" >>${FILE}
echo "CAT5 IP = ${WIREIP}" >>${FILE}
echo "${FORCE}" >>${FILE}
echo "crontab set to auto run ever ${AUTORUN} minutes" >>${FILE}
#get cron contents
crontab -l > $DIR/cron.txt
crontab -l >${DIR}/cron.txt
#get gps info
GPSD=$(systemctl is-active gpsd)
CHRONY=$(systemctl is-active chronyd)
echo "/etc/default/gpsd file contents" > $DIR/gps.info
echo;echo >> $DIR/gps.info
cat /etc/default/gpsd >> $DIR/gps.info
echo;echo;echo >> $DIR/gps.info
echo "GPSD is $GPSD" >> $DIR/gps.info
echo "Chrony is $CHRONY" >> $DIR/gps.info
echo;echo;echo "#####TIME SOURCES#####" >> $DIR/gps.info
chronyc sources -v >> $DIR/gps.info
echo "/etc/default/gpsd file contents" >${DIR}/gps.info
echo
echo >>${DIR}/gps.info
cat /etc/default/gpsd >>${DIR}/gps.info
echo
echo
echo >>${DIR}/gps.info
echo "GPSD is $GPSD" >>${DIR}/gps.info
echo "Chrony is $CHRONY" >>${DIR}/gps.info
echo
echo
echo "#####TIME SOURCES#####" >>${DIR}/gps.info
chronyc sources -v >>${DIR}/gps.info
#Check installed apps
echo "Hotspot $HOTSPOT" > $DIR/apps.info
echo "HS Tools $HSTOOLS" >> $DIR/apps.info
echo "AX25 $AX25" >> $DIR/apps.info
echo "GPS $GPS" >> $DIR/apps.info
echo "Pulse $PULSE" >> $DIR/apps.info
echo "ARDOP GUI $ARDOPGUI" >> $DIR/apps.info
echo "CONKY $CONKY" >> $DIR/apps.info
echo "HAMLIB $RIG" >> $DIR/apps.info
echo "FLRIG $FLRIG" >> $DIR/apps.info
echo "PAT $PAT" >> $DIR/apps.info
echo "DIREWOLF $DIRE" >> $DIR/apps.info
echo "Pat Menu $PATMENU" >> $DIR/apps.info
echo "EES $EES" >> $DIR/apps.info
echo "Hotspot $HOTSPOT" >${DIR}/apps.info
echo "HS Tools $HSTOOLS" >>${DIR}/apps.info
echo "AX25 $AX25" >>${DIR}/apps.info
echo "GPS $GPS" >>${DIR}/apps.info
echo "Pulse $PULSE" >>${DIR}/apps.info
echo "ARDOP GUI $ARDOPGUI" >>${DIR}/apps.info
echo "CONKY $CONKY" >>${DIR}/apps.info
echo "HAMLIB $RIG" >>${DIR}/apps.info
echo "FLRIG $FLRIG" >>${DIR}/apps.info
echo "PAT $PAT" >>${DIR}/apps.info
echo "DIREWOLF $DIRE" >>${DIR}/apps.info
echo "Pat Menu $PATMENU" >>${DIR}/apps.info
echo "EES $EES" >>${DIR}/apps.info
cd $HOME/Desktop
zip -r $CALL-diagnostic.zip $DIR > /dev/null 2>&1
cd ${HOME}/Desktop || exit
zip -r ${CALL}-diagnostic.zip ${DIR} >/dev/null 2>&1
rm -rf $DIR > /dev/null 2>&1
clear;echo;echo
rm -rf ${DIR} >/dev/null 2>&1
clear
echo
echo
cat <<EOF
DONE!!
@ -316,20 +318,10 @@ Email the diagnostic.zip file located on your desktop
to km4ack@arrl.net along with a description of your issue
and a link to the original forum post.
All discussion/help is provided on the forum to
All discussion/help is provided on the forum to
benefit the community at large.
https://groups.io/g/KM4ACK-Pi/topics
73, de KM4ACK
EOF

Wyświetl plik

@ -1,147 +1,144 @@
#additional software to install with build-a-pi
#20200513 km4ack
TEMPCRON=$MYPATH/cron.tmp
DIR=$MYPATH/temp
TEMPCRON=${MYPATH}/cron.tmp
DIR=${MYPATH}/temp
WHO=$(whoami)
mkdir -p $DIR
mkdir -p ${DIR}
source $MYPATH/config
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
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
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
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
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
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 wsjtx_2.2.2_armhf.deb
fi
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(){
CONKY() {
if ! hash conky 2>/dev/null; then
sudo apt install -y conky
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
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
#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
cat <<EOF >${HOME}/.local/share/applications/conky.desktop
[Desktop Entry]
Name=Conky
Comment=Conky
@ -155,12 +152,12 @@ Categories=HamRadio
Keywords=Radio
EOF
ln -sf $HOME/.local/share/applications/conky.desktop $HOME/.config/autostart/conky.desktop
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
#####Add setconky to main menu
chmod +x ${HOME}/pi-build/conky/setconky
cat <<EOF > $HOME/.local/share/applications/setconky.desktop
cat <<EOF >${HOME}/.local/share/applications/setconky.desktop
[Desktop Entry]
Name=Conky-Prefs
Comment=Conky-Prefs
@ -179,15 +176,15 @@ EOF
##################################
# M0IAX Tools
##################################
M0IAX(){
cd $DIR
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
M0IAX() {
cd ${DIR} || exit
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
cat >m0iax.desktop <<EOF
[Desktop Entry]
Name=M0IAX JS8 Utils
GenericName=M0IAX JS8 Utils
@ -198,41 +195,41 @@ Type=Application
Categories=Network;HamRadio;
EOF
sudo mv m0iax.desktop /usr/share/applications/
sudo mv m0iax.desktop /usr/share/applications/
}
##################################
# PYQSO
##################################
PYQSO(){
sudo apt-get install -y 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
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
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
cd
git clone https://github.com/ok2cqr/cqrlog.git
cd cqrlog
make
sudo make install
cd ..
rm -rf cqrlog
cat > cqrlog.desktop <<EOF
cat >cqrlog.desktop <<EOF
[Desktop Entry]
Name=CQRLOG
Comment=Amateur Radio Logging Software
@ -244,183 +241,181 @@ Terminal=false
Categories=HamRadio;Utility
EOF
sudo mv cqrlog.desktop /usr/share/applications/
sudo mv cqrlog.desktop /usr/share/applications/
}
##################################
# CHIRP
##################################
CHIRP(){
cd $DIR
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
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
sudo python setup.py install
pip install future
CHIRP() {
cd ${DIR} || exit
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 || exit
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 || exit
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
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
./configure
make
sudo make install
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} || exit
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} || exit
./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
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
cd ${HOME}/Downloads || exit
#not working with 9.5.1
#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
#SSTVTAR=$(echo $TAR | sed 's/.tar.gz//;s/.0//')
#tar -xvzf $TAR
#cd $SSTVTAR
#qmake
#make
#sudo make install
#not working with 9.5.1
#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
#SSTVTAR=$(echo $TAR | sed 's/.tar.gz//;s/.0//')
#tar -xvzf $TAR
#cd $SSTVTAR || exit
#qmake
#make
#sudo make install
#hard code for 9.4.4 as temp wrokaround 02MARCH2021
wget --tries 2 --connect-timeout=60 http://users.telenet.be/on4qz/qsstv/downloads/qsstv_9.4.4.tar.gz
tar -xvzf qsstv_9.4.4.tar.gz
cd qsstv_9.4.4
qmake
make
sudo make install
#hard code for 9.4.4 as temp wrokaround 02MARCH2021
wget --tries 2 --connect-timeout=60 http://users.telenet.be/on4qz/qsstv/downloads/qsstv_9.4.4.tar.gz
tar -xvzf qsstv_9.4.4.tar.gz
cd qsstv_9.4.4 || exit
qmake
make
sudo make install
sudo sed -i 's/Education;/Network;HamRadio;/' /usr/local/share/applications/qsstv.desktop
sudo sed -i 's/Education;/Network;HamRadio;/' /usr/local/share/applications/qsstv.desktop
}
##################################
# GRIDTRACKER
##################################
GRIDTRACKER(){
cd $HOME
sudo apt-get install -y libgconf-2-4
GRIDDLL=$(curl -s https://tagloomis.com/downloads/ | grep Arm | head -1 | sed 's/.*href="//' | sed 's/.gz.*$/.gz/')
wget --tries 2 --connect-timeout=60 $GRIDDLL
GRIDTAR=$(echo $GRIDDLL | sed 's/.*\///g')
tar -xzvf $GRIDTAR
rm *.gz
cat > gridtracker.desktop <<EOF
GRIDTRACKER() {
cd ${HOME} || exit
sudo apt-get install -y libgconf-2-4
GRIDDLL=$(curl -s https://tagloomis.com/downloads/ | grep Arm | head -1 | sed 's/.*href="//' | sed 's/.gz.*$/.gz/')
wget --tries 2 --connect-timeout=60 $GRIDDLL
GRIDTAR=$(echo $GRIDDLL | sed 's/.*\///g')
tar -xzvf $GRIDTAR
rm ./*.gz
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
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/
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
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
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
./configure
make
sudo make install
#install primary program
cd ${HOME}/Downloads || exit
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 || exit
./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
#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
#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
touch YAAC
echo "#!/bin/bash" >> YAAC
echo "java -jar $HOME/YAAC/YAAC.jar" >> YAAC
chmod +x YAAC
cat > yaac.desktop <<EOF
YAAC() {
cd ${DIR} || exit
#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 || exit
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
Exec=${HOME}/YAAC/YAAC
Terminal=false
Type=Application
Categories=Network;HamRadio;
EOF
sudo mv yaac.desktop /usr/share/applications/
unzip $DIR/YAAC.zip
sudo mv yaac.desktop /usr/share/applications/
unzip ${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
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
###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 || exit
git clone https://github.com/Xastir/Xastir.git
cd Xastir || exit
./bootstrap.sh
mkdir build
cd build || exit
../configure
make
sudo make install
cd || exit
rm -rf Xastir
cd
git clone https://github.com/Xastir/Xastir.git
cd Xastir
./bootstrap.sh
mkdir build; cd build
../configure
make
sudo make install
cd
rm -rf Xastir
cat > xastir.desktop <<EOF
cat >xastir.desktop <<EOF
[Desktop Entry]
Name=Xastir
Comment=X Amateur Station Tracking and Information Reporting
@ -432,7 +427,7 @@ Categories=Network;HamRadio
Keywords=APRS;AX.25;HamRadio
EOF
sudo mv xastir.desktop /usr/share/applications/
sudo mv xastir.desktop /usr/share/applications/
}
@ -440,94 +435,91 @@ sudo mv xastir.desktop /usr/share/applications/
# KM4ACK EES
##################################
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
git clone https://github.com/km4ack/EES-LITE.git
cd $DIR/EES-LITE
#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
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
#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
#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} || exit
git clone https://github.com/km4ack/EES-LITE.git
cd ${DIR}/EES-LITE || exit
#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 || exit
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} || exit
#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
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
git clone https://github.com/km4ack/Pi-APRS.git
sudo cp ~/Pi-APRS/piaprs.desktop /usr/share/applications
PI-APRS() {
cd ${HOME} || exit
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
curl -o ESPHamClock.zip http://www.clearskyinstitute.com/ham/HamClock/ESPHamClock.zip
unzip ESPHamClock.zip
rm ESPHamClock.zip
cd ESPHamClock
sudo make -j 4 hamclock
sudo chmod +s hamclock
sudo mv hamclock /usr/local/bin/hamclock
rm -rf $DIR/ESPHamClock
SMALL() {
sudo apt-get -y install make g++ libx11-dev
cd ${DIR} || exit
curl -o ESPHamClock.zip http://www.clearskyinstitute.com/ham/HamClock/ESPHamClock.zip
unzip ESPHamClock.zip
rm ESPHamClock.zip
cd ESPHamClock || exit
sudo make -j 4 hamclock
sudo chmod +s hamclock
sudo mv hamclock /usr/local/bin/hamclock
rm -rf "${DIR}/ESPHamClock"
cat > $HOME/Downloads/hamclock.desktop <<EOF
cat >${HOME}/Downloads/hamclock.desktop <<EOF
[Desktop Entry]
Name=HamClock
GenericName=Ham Clock
@ -539,25 +531,25 @@ Type=Application
Categories=HamRadio;
EOF
sudo mv $HOME/Downloads/hamclock.desktop /usr/share/applications/
sudo mv ${HOME}/Downloads/hamclock.desktop /usr/share/applications/
}
##################################
# HamClock Large
##################################
LARGE(){
sudo apt-get -y install make g++ libx11-dev
cd $DIR
curl -o ESPHamClock.zip http://www.clearskyinstitute.com/ham/HamClock/ESPHamClock.zip
unzip ESPHamClock.zip
rm ESPHamClock.zip
cd ESPHamClock
sudo make -j 4 hamclock-1600x960
sudo chmod +s hamclock-1600x960
sudo mv hamclock-1600x960 /usr/local/bin/hamclock
rm -rf $DIR/ESPHamClock
LARGE() {
sudo apt-get -y install make g++ libx11-dev
cd ${DIR} || exit
curl -o ESPHamClock.zip http://www.clearskyinstitute.com/ham/HamClock/ESPHamClock.zip
unzip ESPHamClock.zip
rm ESPHamClock.zip
cd ESPHamClock || exit
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
cat >${HOME}/Downloads/hamclock.desktop <<EOF
[Desktop Entry]
Name=HamClock
GenericName=Ham Clock
@ -569,69 +561,68 @@ Type=Application
Categories=HamRadio;
EOF
sudo mv $HOME/Downloads/hamclock.desktop /usr/share/applications/
sudo mv ${HOME}/Downloads/hamclock.desktop /usr/share/applications/
}
##################################
# Gpredict
##################################
GPREDICT(){
sudo apt install -y 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
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
cmake .
make
sudo make install
sudo cp /home/pi/tqsl-$CUR/apps/tqsl.desktop /usr/share/applications/
rm -rf $HOME/tqsl-$CUR
TQSL() {
sudo apt install -y cmake g++ libexpat1-dev libssl-dev libdb++-dev libcurl4-openssl-dev libwxgtk3.0-dev
cd ${HOME} || exit
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} || exit
cmake .
make
sudo make install
sudo cp /home/pi/tqsl-${CUR}/apps/tqsl.desktop /usr/share/applications/
rm -rf "${HOME}/tqsl-${CUR}"
}
##################################
# XLOG
##################################
XLOG(){
#verify hamlib installed
if ! hash rigctld 2>/dev/null; then
cat <<EOF > $HOME/Desktop/XLOG.txt
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
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.*$//')
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//')
DIRXLOG=$(echo ${TARXLOG} | sed 's/.tar.gz//')
cd $HOME
cd ${HOME} || exit
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 $DIRXLOG
./configure
make
sudo make install
cd $HOME
rm -rf $DIRXLOG
fi
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 || exit
./configure
make
sudo make install
cd ${HOME} || exit
rm -rf "${DIR}XLOG"
fi
}
##################################
@ -642,19 +633,17 @@ fi
#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
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
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
sudo dpkg -i ${VER}
sudo apt-get --fix-broken -y install
sudo dpkg -i ${VER}
rm ${VER}
}

Wyświetl plik

@ -13,12 +13,11 @@ shackwifi=$1
shackpass=$2
wifipasswd=$3
#escape all "&" incase used in HS password
wifipasswd=$(sed 's|&|\\&|g' <<< $wifipasswd)
wifipasswd=$(sed 's|&|\\&|g' <<<${wifipasswd})
#unblock wifi
#needed after buster 20200205
rfkill unblock all > /dev/null 2>&1
rfkill unblock all >/dev/null 2>&1
#install hostapd, dnsmasq
apt-get install -y hostapd
@ -31,45 +30,44 @@ systemctl unmask hostapd
systemctl disable hostapd
systemctl disable dnsmasq
mkdir -p $HOME/temp
cd $HOME/temp
mkdir -p ${HOME}/temp
cd ${HOME}/temp || exit
wget http://www.raspberryconnect.com/images/Autohotspot/autohotspot-95-4/hostapd.txt
#set new hotspot passwd
sed -i "s|wpa_passphrase=1234567890|wpa_passphrase=$wifipasswd|" $HOME/temp/hostapd.txt
sed -i "s|wpa_passphrase=1234567890|wpa_passphrase=${wifipasswd}|" ${HOME}/temp/hostapd.txt
#set country to US
sed -i 's/country_code=GB/country_code=US/' $HOME/temp/hostapd.txt
sed -i 's/country_code=GB/country_code=US/' ${HOME}/temp/hostapd.txt
#move hostapd to correct location
mv $HOME/temp/hostapd.txt /etc/hostapd/hostapd.conf
mv ${HOME}/temp/hostapd.txt /etc/hostapd/hostapd.conf
sed -i s'/#DAEMON_CONF=""/DAEMON_CONF="\/etc\/hostapd\/hostapd.conf"/' /etc/default/hostapd
sed -i s'/DAEMON_OPTS=""/#DAEMON_OPTS=""/' /etc/default/hostapd
#add needed info to dnsmasq.conf
echo "#AutoHotspot config" >> /etc/dnsmasq.conf
echo "interface=wlan0" >> /etc/dnsmasq.conf
echo "bind-dynamic" >> /etc/dnsmasq.conf
echo "server=8.8.8.8" >> /etc/dnsmasq.conf
echo "domain-needed" >> /etc/dnsmasq.conf
echo "bogus-priv" >> /etc/dnsmasq.conf
echo "dhcp-range=10.10.10.150,10.10.10.200,255.255.255.0,12h" >> /etc/dnsmasq.conf
echo "#Set up redirect for email.com" >> /etc/dnsmasq.conf
echo "dhcp-option=3,10.10.10.10" >> /etc/dnsmasq.conf
echo "address=/email.com/10.10.10.10" >> /etc/dnsmasq.conf
echo "#AutoHotspot config" >>/etc/dnsmasq.conf
echo "interface=wlan0" >>/etc/dnsmasq.conf
echo "bind-dynamic" >>/etc/dnsmasq.conf
echo "server=8.8.8.8" >>/etc/dnsmasq.conf
echo "domain-needed" >>/etc/dnsmasq.conf
echo "bogus-priv" >>/etc/dnsmasq.conf
echo "dhcp-range=10.10.10.150,10.10.10.200,255.255.255.0,12h" >>/etc/dnsmasq.conf
echo "#Set up redirect for email.com" >>/etc/dnsmasq.conf
echo "dhcp-option=3,10.10.10.10" >>/etc/dnsmasq.conf
echo "address=/email.com/10.10.10.10" >>/etc/dnsmasq.conf
mv /etc/network/interfaces /etc/network/interfaces.org
echo "source-directory /etc/network/interfaces.d" >> /etc/network/interfaces
echo "source-directory /etc/network/interfaces.d" >>/etc/network/interfaces
echo "nohook wpa_supplicant" >> /etc/dhcpcd.conf
echo "nohook wpa_supplicant" >>/etc/dhcpcd.conf
#setup ip forward
sed 's/#net.ipv4.ip_forward=1/net.ipv4.ip_forward=1/' /etc/sysctl.conf
cd $HOME/temp
cd ${HOME}/temp || exit
wget http://www.raspberryconnect.com/images/autohotspotN/autohotspotn-95-4/autohotspot-service.txt
@ -82,13 +80,12 @@ systemctl enable autohotspot.service
#check if iw installed. install if not
iwcheck=$(dpkg --get-selections | grep -w "iw")
if [ -z "iw" ]
then
apt-get install iw
if [ -z "iw" ]; then #THIS MIGHT NEED TO SOME LOOKING AT -- SEE SC2157
apt-get install iw
fi
#install autohotspot script
cd $HOME/temp
cd ${HOME}/temp || exit
wget http://www.raspberryconnect.com/images/autohotspotN/autohotspotn-95-4/autohotspotN.txt
#mod ip address for our custom setup
sed -i 's/192.168.50.5/10.10.10.10/' autohotspotN.txt
@ -96,8 +93,8 @@ mv autohotspotN.txt /usr/bin/autohotspotN
chmod +x /usr/bin/autohotspotN
#add shack wifi to wpa_supplicant.conf
echo "network={" >> /etc/wpa_supplicant/wpa_supplicant.conf
echo "ssid=\"$shackwifi\"" >> /etc/wpa_supplicant/wpa_supplicant.conf
echo "psk=\"$shackpass\"" >> /etc/wpa_supplicant/wpa_supplicant.conf
echo "key_mgmt=WPA-PSK" >> /etc/wpa_supplicant/wpa_supplicant.conf
echo "}" >> /etc/wpa_supplicant/wpa_supplicant.conf
echo "network={" >>/etc/wpa_supplicant/wpa_supplicant.conf
echo "ssid=\"$shackwifi\"" >>/etc/wpa_supplicant/wpa_supplicant.conf
echo "psk=\"$shackpass\"" >>/etc/wpa_supplicant/wpa_supplicant.conf
echo "key_mgmt=WPA-PSK" >>/etc/wpa_supplicant/wpa_supplicant.conf
echo "}" >>/etc/wpa_supplicant/wpa_supplicant.conf

Wyświetl plik

@ -1,61 +1,61 @@
#this installs the basic software for build-a-pi
#km4ack 20200513
TEMPCRON=$MYPATH/cron.tmp
DIR=$MYPATH/temp
mkdir -p $DIR
TEMPCRON=${MYPATH}/cron.tmp
DIR=${MYPATH}/temp
mkdir -p ${DIR}
source $MYPATH/config
source ${MYPATH}/config
################################
# HOTSPOT
################################
HOTSPOT(){
HS="/usr/bin/autohotspotN"
if [ ! -f "$HS" ]; then
#pass variables with script because run as root
sudo bash $MYPATH/functions/autohotspot "$SHACKSSID" "$SHACKPASS" "$HSPASS"
echo "*/5 * * * * sudo /usr/bin/autohotspotN >/dev/null 2>&1" >> $TEMPCRON
else
echo ################################
echo ################################
echo " FATAL ERROR"
echo "HOTSPOT ALREADY INSTALLED ONCE"
echo " CANNOT INSTALL AGAIN"
echo " WILL CONTINUE IN 10 SECONDS"
echo ################################
echo ################################
sleep 10
fi
HOTSPOT() {
HS="/usr/bin/autohotspotN"
if [ ! -f "${HS}" ]; then
#pass variables with script because run as root
sudo bash ${MYPATH}/functions/autohotspot "${SHACKSSID}" "${SHACKPASS}" "${HSPASS}"
echo "*/5 * * * * sudo /usr/bin/autohotspotN >/dev/null 2>&1" >>${TEMPCRON}
else
echo ################################
echo ################################
echo " FATAL ERROR"
echo "HOTSPOT ALREADY INSTALLED ONCE"
echo " CANNOT INSTALL AGAIN"
echo " WILL CONTINUE IN 10 SECONDS"
echo ################################
echo ################################
sleep 10
fi
}
################################
# HOTSPOT TOOLS
################################
HSTOOLS(){
if [ -d $HOME/hotspot-tools2 ]; then
rm -rf $HOME/hotspot-tools2
fi
git clone https://github.com/km4ack/hotspot-tools2.git $HOME/hotspot-tools2
sudo cp $HOME/hotspot-tools2/hstools.desktop /usr/share/applications/hotspot-tools.desktop
HSTOOLS() {
if [ -d ${HOME}/hotspot-tools2 ]; then
rm -rf ${HOME}/hotspot-tools2
fi
git clone https://github.com/km4ack/hotspot-tools2.git ${HOME}/hotspot-tools2
sudo cp ${HOME}/hotspot-tools2/hstools.desktop /usr/share/applications/hotspot-tools.desktop
}
################################
# GPS
################################
GPS(){
cd $DIR
wget --tries 2 --connect-timeout=60 https://raw.githubusercontent.com/km4ack/pi-scripts/master/gpsinstall
chmod +x $DIR/gpsinstall
sudo $DIR/gpsinstall
rm $DIR/gpsinstall
#Set GPS by serial ID
#GPS Variable set by main script or update script
#and placed in config file
sudo sed -i "s|DEVICES.*$|DEVICES=\"$GPS\"|g" /etc/default/gpsd
GPS() {
cd ${DIR} || exit
wget --tries 2 --connect-timeout=60 https://raw.githubusercontent.com/km4ack/pi-scripts/master/gpsinstall
chmod +x ${DIR}/gpsinstall
sudo ${DIR}/gpsinstall
rm ${DIR}/gpsinstall
#Set GPS by serial ID
#GPS Variable set by main script or update script
#and placed in config file
sudo sed -i "s|DEVICES.*$|DEVICES=\"$GPS\"|g" /etc/default/gpsd
#add xgps to menu
cat > xgps.desktop <<EOF
#add xgps to menu
cat >xgps.desktop <<EOF
[Desktop Entry]
Name=XGPS
GenericName=XGPS
@ -67,131 +67,102 @@ Type=Application
Categories=Utility
EOF
sudo mv xgps.desktop /usr/share/applications/
sudo mv xgps.desktop /usr/share/applications/
}
################################
# ARDOP
################################
ARDOP(){
mkdir -p $HOME/ardop
cd $HOME/ardop
wget --tries 2 --connect-timeout=60 https://www.cantab.net/users/john.wiseman/Downloads/Beta/piardopc
sudo chmod +x $HOME/ardop/piardopc
ARDOP() {
mkdir -p ${HOME}/ardop
cd ${HOME}/ardop || exit
wget --tries 2 --connect-timeout=60 https://www.cantab.net/users/john.wiseman/Downloads/Beta/piardopc
sudo chmod +x ${HOME}/ardop/piardopc
}
################################
# ARDOP GUI
################################
ARDOPGUI(){
mkdir -p $HOME/ardop
cd $HOME/ardop
wget --tries 2 --connect-timeout=60 https://www.cantab.net/users/john.wiseman/Downloads/Beta/piARDOP_GUI
sudo chmod +x $HOME/ardop/piARDOP_GUI
cat > ardopgui.desktop <<EOF
ARDOPGUI() {
mkdir -p ${HOME}/ardop
cd ${HOME}/ardop || exit
wget --tries 2 --connect-timeout=60 https://www.cantab.net/users/john.wiseman/Downloads/Beta/piARDOP_GUI
sudo chmod +x ${HOME}/ardop/piARDOP_GUI
cat >ardopgui.desktop <<EOF
[Desktop Entry]
Name=ARDOP GUI
GenericName=ARDOP GUI
Comment=Graphical User Interface for ARDOP modem
Exec=$HOME/ardop/piARDOP_GUI
Exec=${HOME}/ardop/piARDOP_GUI
Terminal=false
Type=Application
Categories=Network;HamRadio;
EOF
sudo mv ardopgui.desktop /usr/share/applications/
FILE=$HOME/.config/G8BPQ/ARDOP_GUI.conf
mkdir -p $HOME/.config/G8BPQ
touch $FILE
echo "[General]" >> $FILE
echo "Host=local" >> $FILE
echo "Port=8515" >> $FILE
sudo mv ardopgui.desktop /usr/share/applications/
FILE=${HOME}/.config/G8BPQ/ARDOP_GUI.conf
mkdir -p ${HOME}/.config/G8BPQ
touch ${FILE}
echo "[General]" >>${FILE}
echo "Host=local" >>${FILE}
echo "Port=8515" >>${FILE}
}
################################
# HAMLIB
################################
HAMLIB(){
cd $DIR
NEWRIG=$(curl -s https://sourceforge.net/projects/hamlib/files/latest/download | \
grep -o https://downloads.sourceforge.net/project/hamlib/hamlib/[0-9].[0-9] | \
head -n 1 | awk -F "/" '{print $7}')
HAMLIBLINK=https://sourceforge.net/projects/hamlib/files/hamlib/$NEWRIG/hamlib-$NEWRIG.tar.gz
cd $HOME/Downloads
echo "###################################"
echo "# Installing Hamlib "
echo "###################################"
wget --tries 2 --connect-timeout=60 $HAMLIBLINK
HAMLIB() {
cd ${DIR} || exit
NEWRIG=$(curl -s https://sourceforge.net/projects/hamlib/files/latest/download |
grep -o https://downloads.sourceforge.net/project/hamlib/hamlib/[0-9].[0-9] |
head -n 1 | awk -F "/" '{print $7}')
HAMLIBLINK=https://sourceforge.net/projects/hamlib/files/hamlib/${NEWRIG}/hamlib-${NEWRIG}.tar.gz
cd ${HOME}/Downloads || exit
echo "###################################"
echo "# Installing Hamlib "
echo "###################################"
wget --tries 2 --connect-timeout=60 ${HAMLIBLINK}
tar -xzf hamlib-$NEWRIG.tar.gz
rm hamlib-$NEWRIG.tar.gz
cd hamlib-$NEWRIG
./configure
make
sudo make install
sudo ldconfig
tar -xzf hamlib-${NEWRIG}.tar.gz
rm hamlib-${NEWRIG}.tar.gz
cd hamlib-${NEWRIG} || exit
./configure
make
sudo make install
sudo ldconfig
}
################################
# DIREWOLF
################################
DIREWOLF(){
cd $HOME
git clone https://www.github.com/wb2osz/direwolf
cd $HOME/direwolf
mkdir build && cd build
sudo apt-get install -y libasound2-dev cmake
cmake ..
make -j 4
sudo make install
make install-conf
sed -i "s/N0CALL/$CALL/" "$HOME/direwolf.conf"
sed -i 's/# ADEVICE plughw:1,0/ADEVICE plughw:2,0/' $HOME/direwolf.conf
sed -i '/#PTT\ \/dev\/ttyUSB0\ RTS/a #Uncomment line below for PTT with sabrent sound card\n#PTT RIG 2 localhost:4532' $HOME/direwolf.conf
rm -rf $HOME/direwolf
DIREWOLF() {
cd ${HOME} || exit
git clone https://www.github.com/wb2osz/direwolf
cd ${HOME}/direwolf || exit
(mkdir build && cd build) || exit
sudo apt-get install -y libasound2-dev cmake
cmake ..
make -j 4
sudo make install
make install-conf
sed -i "s/N0CALL/${CALL}/" "${HOME}/direwolf.conf"
sed -i 's/# ADEVICE plughw:1,0/ADEVICE plughw:2,0/' ${HOME}/direwolf.conf
sed -i '/#PTT\ \/dev\/ttyUSB0\ RTS/a #Uncomment line below for PTT with sabrent sound card\n#PTT RIG 2 localhost:4532' ${HOME}/direwolf.conf
rm -rf ${HOME}/direwolf
}
################################
# AX25
################################
AX25(){
sudo apt-get install -y ax25-tools
echo "wl2k "$CALL" 1200 255 7 Winlink" | sudo tee -a /etc/ax25/axports
sudo apt-get install -y ax25-apps
AX25() {
sudo apt-get install -y ax25-tools
echo "wl2k ${CALL} 1200 255 7 Winlink" | sudo tee -a /etc/ax25/axports
sudo apt-get install -y ax25-apps
}
################################
# PULSE AUDIO Control
################################
PULSE(){
sudo apt-get install -y pavucontrol
PULSE() {
sudo apt-get install -y pavucontrol
}

Wyświetl plik

@ -1,203 +1,192 @@
#script to install FLDIGI from source
#20200121 km4ack
mkdir -p $HOME/Downloads
FLSTART(){
#find how much memory we are working with
FREEMEM=$(free -m | grep Mem: | awk '{ print $2 }')
echo $FREEMEM
mkdir -p ${HOME}/Downloads
FLSTART() {
#find how much memory we are working with
FREEMEM=$(free -m | grep Mem: | awk '{ print $2 }')
echo ${FREEMEM}
##################################
# INCREASE SWAP
##################################
#increase swap file if less than 3G memory
if [ $FREEMEM -lt 3000 ]
then
echo "Increasing Swap size for build"
#increase swap size
sudo sed -i 's/#CONF_SWAPFILE=\/var\/swap/CONF_SWAPFILE=\/var\/swap/' /etc/dphys-swapfile
sudo sed -i 's/CONF_SWAPSIZE=100/CONF_SWAPSIZE=1024/' /etc/dphys-swapfile
sudo /etc/init.d/dphys-swapfile restart
sleep 10
fi
##################################
# INCREASE SWAP
##################################
#increase swap file if less than 3G memory
if [ ${FREEMEM} -lt 3000 ]; then
echo "Increasing Swap size for build"
#increase swap size
sudo sed -i 's/#CONF_SWAPFILE=\/var\/swap/CONF_SWAPFILE=\/var\/swap/' /etc/dphys-swapfile
sudo sed -i 's/CONF_SWAPSIZE=100/CONF_SWAPSIZE=1024/' /etc/dphys-swapfile
sudo /etc/init.d/dphys-swapfile restart
sleep 10
fi
##################################
# DEPENDS
##################################
#install needed depends
sudo apt-get install -y libfltk1.3-dev libjpeg9-dev libxft-dev libxinerama-dev libxcursor-dev libsndfile1-dev libsamplerate0-dev portaudio19-dev libpulse-dev libusb-1.0-0-dev texinfo
##################################
# DEPENDS
##################################
#install needed depends
sudo apt-get install -y libfltk1.3-dev libjpeg9-dev libxft-dev libxinerama-dev libxcursor-dev libsndfile1-dev libsamplerate0-dev portaudio19-dev libpulse-dev libusb-1.0-0-dev texinfo
##################################
# FLXMLRPC
##################################
FLX=$(ldconfig -p | grep flxmlrpc)
##################################
# FLXMLRPC
##################################
FLX=$(ldconfig -p | grep flxmlrpc)
if [ -z "$FLX" ]
then
#determine latest FLXMLRPC & download
FLXM=$(curl -s http://www.w1hkj.com/files/flxmlrpc/ | grep .tar.gz | sed 's/<li><a\ href="//' | sed 's/">\ flxmlrpc.*$//')
XMPKG=$( echo $FLXM | sed 's/.tar.gz//')
cd $HOME/Downloads
wget --tries 2 --connect-timeout=60 http://www.w1hkj.com/files/flxmlrpc/$FLXM
tar -zxvf $FLXM
rm *.gz
if [ -z "$FLX" ]; then
#determine latest FLXMLRPC & download
FLXM=$(curl -s http://www.w1hkj.com/files/flxmlrpc/ | grep .tar.gz | sed 's/<li><a\ href="//' | sed 's/">\ flxmlrpc.*$//')
XMPKG=$(echo ${FLXM} | sed 's/.tar.gz//')
cd ${HOME}/Downloads || exit
wget --tries 2 --connect-timeout=60 http://www.w1hkj.com/files/flxmlrpc/${FLXM}
tar -zxvf ${FLXM}
rm ./*.gz #THIS IS DANGEROUS -- SEE SC2035
#build FLXMLRPC
cd $XMPKG
./configure --prefix=/usr/local --enable-static
make
sudo make install
sudo ldconfig
#build FLXMLRPC
cd ${XMPKG} || exit
./configure --prefix=/usr/local --enable-static
make
sudo make install
sudo ldconfig
fi
}
##################################
# FLRIG
##################################
FLRIG(){
#Determine latest FLRIG
RIGTAR=$(curl -s http://www.w1hkj.com/files/flrig/ | grep .tar.gz | sed 's/<li><a\ href="//' | sed 's/">\ flrig.*$//' | tail -1)
RIGPKG=$(echo $RIGTAR | sed 's/.tar.gz//')
FLRIG() {
#Determine latest FLRIG
RIGTAR=$(curl -s http://www.w1hkj.com/files/flrig/ | grep .tar.gz | sed 's/<li><a\ href="//' | sed 's/">\ flrig.*$//' | tail -1)
RIGPKG=$(echo ${RIGTAR} | sed 's/.tar.gz//')
#Download latest FLRIG
cd $HOME/Downloads
wget --tries 2 --connect-timeout=60 http://www.w1hkj.com/files/flrig/$RIGTAR
tar -zxvf $RIGTAR
rm *.gz
#Download latest FLRIG
cd ${HOME}/Downloads || exit
wget --tries 2 --connect-timeout=60 http://www.w1hkj.com/files/flrig/${RIGTAR}
tar -zxvf ${RIGTAR}
rm ./*.gz #THIS IS DANGEROUS -- SEE SC2035
#Build FLRIG
cd $RIGPKG
./configure --prefix=/usr/local --enable-static
make
sudo make install
sudo ldconfig
#Build FLRIG
cd ${RIGPKG} || exit
./configure --prefix=/usr/local --enable-static
make
sudo make install
sudo ldconfig
}
##################################
# FLWRAP
##################################
FLWRAP(){
#Determine latest FLWRAP
WRAPTAR=$(curl -s http://www.w1hkj.com/files/flwrap/ | grep .tar.gz | sed 's/<li><a\ href="//' | sed 's/">\ flwrap.*$//')
WRAPPKG=$(echo $WRAPTAR | sed 's/.tar.gz//')
FLWRAP() {
#Determine latest FLWRAP
WRAPTAR=$(curl -s http://www.w1hkj.com/files/flwrap/ | grep .tar.gz | sed 's/<li><a\ href="//' | sed 's/">\ flwrap.*$//')
WRAPPKG=$(echo ${WRAPTAR} | sed 's/.tar.gz//')
#Download latest FLWRAP
cd $HOME/Downloads
wget --tries 2 --connect-timeout=60 http://www.w1hkj.com/files/flwrap/$WRAPTAR
tar -zxvf $WRAPTAR
rm *.gz
#Download latest FLWRAP
cd ${HOME}/Downloads || exit
wget --tries 2 --connect-timeout=60 http://www.w1hkj.com/files/flwrap/${WRAPTAR}
tar -zxvf ${WRAPTAR}
rm ./*.gz #THIS IS DANGEROUS -- SEE SC2035
#Build FLRIG
cd $WRAPPKG
./configure --prefix=/usr/local --enable-static
make
sudo make install
sudo ldconfig
#Build FLRIG
cd ${WRAPPKG} || exit
./configure --prefix=/usr/local --enable-static
make
sudo make install
sudo ldconfig
}
##################################
# FLDIGI
##################################
FLDIGI(){
#Determine latest FLDIGI
FLTAR=$(curl -s http://www.w1hkj.com/files/fldigi/ | grep .tar.gz | sed 's/<li><a\ href="//' | sed 's/">\ fldigi.*$//')
FLPKG=$(echo $FLTAR | sed 's/.tar.gz//')
FLDIGI() {
#Determine latest FLDIGI
FLTAR=$(curl -s http://www.w1hkj.com/files/fldigi/ | grep .tar.gz | sed 's/<li><a\ href="//' | sed 's/">\ fldigi.*$//')
FLPKG=$(echo ${FLTAR} | sed 's/.tar.gz//')
#Download latest FLDIGI tar file
cd $HOME/Downloads
wget --tries 2 --connect-timeout=60 http://www.w1hkj.com/files/fldigi/$FLTAR
tar -zxvf $FLTAR
rm *.gz
#Download latest FLDIGI tar file
cd ${HOME}/Downloads || exit
wget --tries 2 --connect-timeout=60 http://www.w1hkj.com/files/fldigi/${FLTAR}
tar -zxvf ${FLTAR}
rm ./*.gz #THIS IS DANGEROUS -- SEE SC2035
#build FLDIGI
cd $FLPKG
./configure --prefix=/usr/local --enable-static
make
sudo make install
sudo ldconfig
#build FLDIGI
cd ${FLPKG} || exit
./configure --prefix=/usr/local --enable-static
make
sudo make install
sudo ldconfig
}
##################################
# FLMSG
##################################
FLMSG(){
#Determine latest FLMSG
MSGTAR=$(curl -s http://www.w1hkj.com/files/flmsg/ | grep .tar.gz | sed 's/<li><a\ href="//' | sed 's/">\ flmsg.*$//' | tail -1)
MSGPKG=$(echo $MSGTAR | sed 's/.tar.gz//')
FLMSG() {
#Determine latest FLMSG
MSGTAR=$(curl -s http://www.w1hkj.com/files/flmsg/ | grep .tar.gz | sed 's/<li><a\ href="//' | sed 's/">\ flmsg.*$//' | tail -1)
MSGPKG=$(echo ${MSGTAR} | sed 's/.tar.gz//')
#download FLMSG
cd $HOME/Downloads
wget --tries 2 --connect-timeout=60 http://www.w1hkj.com/files/flmsg/$MSGTAR
tar -zxvf $MSGTAR
rm *.gz
#download FLMSG
cd ${HOME}/Downloads || exit
wget --tries 2 --connect-timeout=60 http://www.w1hkj.com/files/flmsg/${MSGTAR}
tar -zxvf ${MSGTAR}
rm ./*.gz #THIS IS DANGEROUS -- SEE SC2035
#Build FLMSG
cd $MSGPKG
./configure --prefix=/usr/local --enable-static
make
sudo make install
sudo ldconfig
#Build FLMSG
cd ${MSGPKG} || exit
./configure --prefix=/usr/local --enable-static
make
sudo make install
sudo ldconfig
}
##################################
# FLAMP
##################################
FLAMP(){
#determine latest FLAMP
AMPTAR=$(curl -s http://www.w1hkj.com/files/flamp/ | grep .tar.gz | sed 's/<li><a\ href="//' | sed 's/">\ flamp.*$//')
AMPPKG=$(echo $AMPTAR | sed 's/.tar.gz//')
FLAMP() {
#determine latest FLAMP
AMPTAR=$(curl -s http://www.w1hkj.com/files/flamp/ | grep .tar.gz | sed 's/<li><a\ href="//' | sed 's/">\ flamp.*$//')
AMPPKG=$(echo ${AMPTAR} | sed 's/.tar.gz//')
#download FLAMP
cd $HOME/Downloads
wget --tries 2 --connect-timeout=60 http://www.w1hkj.com/files/flamp/$AMPTAR
tar -zxvf $AMPTAR
rm *.gz
#download FLAMP
cd ${HOME}/Downloads || exit
wget --tries 2 --connect-timeout=60 http://www.w1hkj.com/files/flamp/$AMPTAR
tar -zxvf ${AMPTAR}
rm ./*.gz #THIS IS DANGEROUS -- SEE SC2035
#build FLAMP
cd $AMPPKG
./configure --prefix=/usr/local --enable-static
make
sudo make install
sudo ldconfig
#build FLAMP
cd ${AMPPKG} || exit
./configure --prefix=/usr/local --enable-static
make
sudo make install
sudo ldconfig
}
##################################
# FLNET
##################################
FLNET(){
#determine lastest FLNET
NETTAR=$(curl -s http://www.w1hkj.com/files/flnet/ | grep .tar.gz | sed 's/<li><a\ href="//' | sed 's/">\ flnet.*$//')
NETPKG=$(echo $NETTAR | sed 's/.tar.gz//')
FLNET() {
#determine lastest FLNET
NETTAR=$(curl -s http://www.w1hkj.com/files/flnet/ | grep .tar.gz | sed 's/<li><a\ href="//' | sed 's/">\ flnet.*$//')
NETPKG=$(echo ${NETTAR} | sed 's/.tar.gz//')
#download FLNET
cd $HOME/Downloads
wget --tries 2 --connect-timeout=60 http://www.w1hkj.com/files/flnet/$NETTAR
tar -zxvf $NETTAR
rm *.gz
#download FLNET
cd ${HOME}/Downloads || exit
wget --tries 2 --connect-timeout=60 http://www.w1hkj.com/files/flnet/$NETTAR
tar -zxvf ${NETTAR}
rm ./*.gz #THIS IS DANGEROUS -- SEE SC2035
#build FLNET
cd $NETPKG
./configure --prefix=/usr/local --enable-static
make
sudo make install
sudo ldconfig
#build FLNET
cd ${NETPKG} || exit
./configure --prefix=/usr/local --enable-static
make
sudo make install
sudo ldconfig
}
##################################
# RESET SWAP
##################################
FLSTOP(){
#reset swap size to default
if [ $FREEMEM -lt 3000 ]
then
echo "Resetting swap size to default"
#increase swap size
sudo sed -i 's/CONF_SWAPFILE=\/var\/swap/#CONF_SWAPFILE=\/var\/swap/' /etc/dphys-swapfile
sudo sed -i 's/CONF_SWAPSIZE=1024/CONF_SWAPSIZE=100/' /etc/dphys-swapfile
sudo /etc/init.d/dphys-swapfile restart
fi
FLSTOP() {
#reset swap size to default
if [ ${FREEMEM} -lt 3000 ]; then
echo "Resetting swap size to default"
#increase swap size
sudo sed -i 's/CONF_SWAPFILE=\/var\/swap/#CONF_SWAPFILE=\/var\/swap/' /etc/dphys-swapfile
sudo sed -i 's/CONF_SWAPSIZE=1024/CONF_SWAPSIZE=100/' /etc/dphys-swapfile
sudo /etc/init.d/dphys-swapfile restart
fi
}

Wyświetl plik

@ -1,109 +1,105 @@
##################################
# DIPOLE CALC
##################################
DIPOLE(){
cd $HOME/bin
wget --tries 2 --connect-timeout=60 https://raw.githubusercontent.com/km4ack/pi-scripts/master/dipole
chmod +x dipole
DIPOLE() {
cd ${HOME}/bin || exit
wget --tries 2 --connect-timeout=60 https://raw.githubusercontent.com/km4ack/pi-scripts/master/dipole
chmod +x dipole
cat > dipole.desktop <<EOF
cat >dipole.desktop <<EOF
[Desktop Entry]
Name=Dipole Calculator
GenericName=Dipole Calc
Comment=Dipole Calculator
Exec=$HOME/bin/dipole
Exec=${HOME}/bin/dipole
Icon=/usr/share/icons/Adwaita/scalable/apps/accessories-calculator-symbolic.svg
Terminal=false
Type=Application
Categories=HamRadio;
EOF
sudo mv dipole.desktop /usr/share/applications/
sudo mv dipole.desktop /usr/share/applications/
}
##################################
# Call Lookup
##################################
CALLSIGN(){
cd $HOME/bin
wget --tries 2 --connect-timeout=60 https://raw.githubusercontent.com/km4ack/pi-scripts/master/getcall
chmod +x getcall
CALLSIGN() {
cd ${HOME}/bin || exit
wget --tries 2 --connect-timeout=60 https://raw.githubusercontent.com/km4ack/pi-scripts/master/getcall
chmod +x getcall
cat > getcall.desktop <<EOF
cat >getcall.desktop <<EOF
[Desktop Entry]
Name=Call Sign Lookup
GenericName=Call sign lookup utility
Comment=Call sign lookup utility
Exec=$HOME/bin/getcall
Exec=${HOME}/bin/getcall
Icon=/usr/share/icons/Adwaita/scalable/apps/user-info-symbolic.svg
Terminal=false
Type=Application
Categories=HamRadio;
EOF
sudo mv getcall.desktop /usr/share/applications/
sudo mv getcall.desktop /usr/share/applications/
}
##################################
# Temp Convert
##################################
TEMPCONVERT(){
if ! hash bc 2>/dev/null; then
sudo apt-get install -y bc
fi
cd $HOME/bin
wget --tries 2 --connect-timeout=60 https://raw.githubusercontent.com/km4ack/pi-scripts/master/converttemp
chmod +x converttemp
TEMPCONVERT() {
if ! hash bc 2>/dev/null; then
sudo apt-get install -y bc
fi
cd ${HOME}/bin || exit
wget --tries 2 --connect-timeout=60 https://raw.githubusercontent.com/km4ack/pi-scripts/master/converttemp
chmod +x converttemp
cat > converttemp.desktop <<EOF
cat >converttemp.desktop <<EOF
[Desktop Entry]
Name=Temperature Converter
GenericName=Temperature Converter
Comment=Utility to convert temperature
Exec=$HOME/bin/converttemp
Exec=${HOME}/bin/converttemp
Icon=/usr/share/icons/Adwaita/22x22/actions/mark-location.png
Terminal=false
Type=Application
Categories=HamRadio;
EOF
sudo mv converttemp.desktop /usr/share/applications/
sudo mv converttemp.desktop /usr/share/applications/
}
##################################
# GPARTED
##################################
GPARTED(){
sudo apt-get install -y gparted
GPARTED() {
sudo apt-get install -y gparted
}
##################################
# Log Viewer | Showlog
##################################
SHOWLOG(){
SHOWLOG() {
cd $HOME/bin
wget https://raw.githubusercontent.com/km4ack/pi-scripts/master/showlog
chmod +x showlog
cd ${HOME}/bin || exit
wget https://raw.githubusercontent.com/km4ack/pi-scripts/master/showlog
chmod +x showlog
cat > showlog.desktop <<EOF
cat >showlog.desktop <<EOF
[Desktop Entry]
Name=Log Viewer
GenericName=KM4ACK Log Viewer
Comment=Log File Viewer
Exec=$HOME/bin/showlog
Exec=${HOME}/bin/showlog
Icon=/usr/share/icons/PiXflat/48x48/apps/fm-details.png
Terminal=false
Type=Application
Categories=Utility
EOF
sudo mv showlog.desktop /usr/share/applications/
sudo mv showlog.desktop /usr/share/applications/
}
##################################
@ -111,120 +107,116 @@ sudo mv showlog.desktop /usr/share/applications/
##################################
#Based on directions from the following web site
#https://thepihut.com/blogs/raspberry-pi-tutorials/17209332-adding-a-real-time-clock-to-your-raspberry-pi
RTC(){
DOUBLE=$(sudo i2cdetect -y 1 | grep UU)
RTC() {
DOUBLE=$(sudo i2cdetect -y 1 | grep UU)
if [ -n "$DOUBLE" ]; then
yad --form --width=500 --text-align=center --center --title="Build-a-Pi" --text-align=center \
--image $LOGO --window-icon=$LOGO --image-on-top --separator="|" --item-separator="|" \
--text="Real Time Clock already installed" \
--button=gtk-close
#exit statement here causes script to exit without finishing. Reference link next line
#https://github.com/km4ack/pi-build/issues/139
if [ -n "$DOUBLE" ]; then
yad --form --width=500 --text-align=center --center --title="Build-a-Pi" --text-align=center \
--image ${LOGO} --window-icon=${LOGO} --image-on-top --separator="|" --item-separator="|" \
--text="Real Time Clock already installed" \
--button=gtk-close
#exit statement here causes script to exit without finishing. Reference link next line
#https://github.com/km4ack/pi-build/issues/139
else
else
IC2ACTIVE=$(ls /dev/*i2c*)
IC2ACTIVE=$(ls /dev/*i2c*)
if [ $IC2ACTIVE = '/dev/i2c-1' ]
then
echo "IC2 is active"
else
yad --form --width=500 --text-align=center --center --title="Build-a-Pi" --text-align=center \
--image $LOGO --window-icon=$LOGO --image-on-top --separator="|" --item-separator="|" \
--text="Please enable IC2 interface in the Raspberry Pi Configuration and try again" \
--button=gtk-close
exit 1
fi
if [ ${IC2ACTIVE} = '/dev/i2c-1' ]; then
echo "IC2 is active"
else
yad --form --width=500 --text-align=center --center --title="Build-a-Pi" --text-align=center \
--image ${LOGO} --window-icon=${LOGO} --image-on-top --separator="|" --item-separator="|" \
--text="Please enable IC2 interface in the Raspberry Pi Configuration and try again" \
--button=gtk-close
exit 1
fi
NOW=$(date)
NOW=$(date)
INFO=$(yad --form --width=500 --text-align=center --center --title="Build-a-Pi" --text-align=center \
--image $LOGO --window-icon=$LOGO --image-on-top --separator="|" --item-separator="|" \
--text="<b>System time is $NOW</b>" \
--field="Is this Correct":CB "yes|no" \
--button="Continue")
echo $?
INFO=$(yad --form --width=500 --text-align=center --center --title="Build-a-Pi" --text-align=center \
--image ${LOGO} --window-icon=${LOGO} --image-on-top --separator="|" --item-separator="|" \
--text="<b>System time is $NOW</b>" \
--field="Is this Correct":CB "yes|no" \
--button="Continue")
echo $?
TIME=$(echo $INFO | awk -F "|" '{print $1}')
TIME=$(echo ${INFO} | awk -F "|" '{print $1}')
if [ $TIME = 'no' ]; then
yad --form --width=500 --text-align=center --center --title="Build-a-Pi" --text-align=center \
--image $LOGO --window-icon=$LOGO --image-on-top --separator="|" --item-separator="|" \
--text="Please set time on the Raspberry Pi and try again. You can set time \
if [ ${TIME} = 'no' ]; then
yad --form --width=500 --text-align=center --center --title="Build-a-Pi" --text-align=center \
--image ${LOGO} --window-icon=${LOGO} --image-on-top --separator="|" --item-separator="|" \
--text="Please set time on the Raspberry Pi and try again. You can set time \
by connecting to the internet or attaching a GPS" \
--button=gtk-close
exit 1
fi
--button=gtk-close
exit 1
fi
CLOCK=$(sudo i2cdetect -y 1 | grep 68)
CLOCK=$(sudo i2cdetect -y 1 | grep 68)
if [ -z "$CLOCK" ]; then
yad --form --width=500 --text-align=center --center --title="Build-a-Pi" --text-align=center \
--image ${LOGO} --window-icon=${LOGO} --image-on-top --separator="|" --item-separator="|" \
--text="Real Time Clock not detected. Please be sure the RTC is installed and seated firmly" \
--button=gtk-close
exit 1
else
sudo modprobe rtc-ds1307
echo "ds1307 0x68" | sudo tee -a /sys/class/i2c-adapter/i2c-1/new_device
sudo hwclock -w
echo rtc-ds1307 | sudo tee -a /etc/modules
if [ -z "$CLOCK" ]; then
yad --form --width=500 --text-align=center --center --title="Build-a-Pi" --text-align=center \
--image $LOGO --window-icon=$LOGO --image-on-top --separator="|" --item-separator="|" \
--text="Real Time Clock not detected. Please be sure the RTC is installed and seated firmly" \
--button=gtk-close
exit 1
else
sudo modprobe rtc-ds1307
echo "ds1307 0x68" | sudo tee -a /sys/class/i2c-adapter/i2c-1/new_device
sudo hwclock -w
echo rtc-ds1307 | sudo tee -a /etc/modules
sudo sed -i 's/exit\ 0//' /etc/rc.local
echo "echo ds1307 0x68 > /sys/class/i2c-adapter/i2c-1/new_device" | sudo tee -a /etc/rc.local >/dev/null 2>&1
echo "sudo hwclock -s" | sudo tee -a /etc/rc.local >/dev/null 2>&1
echo "date" | sudo tee -a /etc/rc.local >/dev/null 2>&1
echo "exit 0" | sudo tee -a /etc/rc.local >/dev/null 2>&1
sudo sed -i 's/exit\ 0//' /etc/rc.local
echo "echo ds1307 0x68 > /sys/class/i2c-adapter/i2c-1/new_device" | sudo tee -a /etc/rc.local > /dev/null 2>&1
echo "sudo hwclock -s" | sudo tee -a /etc/rc.local > /dev/null 2>&1
echo "date" | sudo tee -a /etc/rc.local > /dev/null 2>&1
echo "exit 0" | sudo tee -a /etc/rc.local > /dev/null 2>&1
yad --form --width=500 --text-align=center --center --title="Build-a-Pi" --text-align=center \
--image ${LOGO} --window-icon=${LOGO} --image-on-top --separator="|" --item-separator="|" \
--text="Real Time Clock has been installed and configured" \
--button=gtk-close
fi
yad --form --width=500 --text-align=center --center --title="Build-a-Pi" --text-align=center \
--image $LOGO --window-icon=$LOGO --image-on-top --separator="|" --item-separator="|" \
--text="Real Time Clock has been installed and configured" \
--button=gtk-close
fi
fi #close first if/then statement
fi #close first if/then statement
}
##################################
# PISTATS
##################################
PISTATS(){
cd $HOME
CUR=$(curl -s http://www.w1hkj.com/pi3/ | grep .tgz | sed 's/.*pistats//' | sed 's/<\/a><br>//')
wget http://www.w1hkj.com/pi3/pistats$CUR
tar -xzvf pistats$CUR
rm pistats$CUR
PISTATDIR=$(ls $HOME | grep pistats)
cd $PISTATDIR
sudo apt-get install -y libfltk1.3-dev
make
sudo mv pistats /usr/local/bin
sudo mv $HOME/$PISTATDIR/data/pistats.desktop /usr/share/applications/
cd $HOME
rm -rf $PISTATDIR
PISTATS() {
cd ${HOME} || exit
CUR=$(curl -s http://www.w1hkj.com/pi3/ | grep .tgz | sed 's/.*pistats//' | sed 's/<\/a><br>//')
wget http://www.w1hkj.com/pi3/pistats${CUR}
tar -xzvf pistats${CUR}
rm pistats${CUR}
PISTATDIR=$(ls ${HOME} | grep pistats)
cd ${PISTATDIR} || exit
sudo apt-get install -y libfltk1.3-dev
make
sudo mv pistats /usr/local/bin
sudo mv ${HOME}/${PISTATDIR}/data/pistats.desktop /usr/share/applications/
cd ${HOME} || exit
rm -rf "${PISTATDIR}"
}
##################################
# TELNET
##################################
TELNET(){
sudo apt install -y telnet
TELNET() {
sudo apt install -y telnet
}
##################################
# PiQtTermTCP
##################################
PITERM(){
cd $DIR
wget https://www.cantab.net/users/john.wiseman/Downloads/Beta/piQtTermTCP
sudo chmod +x piQtTermTCP
sudo mv piQtTermTCP /usr/local/bin/
PITERM() {
cd ${DIR} || exit
wget https://www.cantab.net/users/john.wiseman/Downloads/Beta/piQtTermTCP
sudo chmod +x piQtTermTCP
sudo mv piQtTermTCP /usr/local/bin/
cat > piqttermtcp.desktop <<EOF
cat >piqttermtcp.desktop <<EOF
[Desktop Entry]
Name=PiQtTermTCP
GenericName=PiQtTermTCP
@ -236,21 +228,21 @@ Type=Application
Categories=Utility
EOF
sudo mv piqttermtcp.desktop /usr/share/applications/
sudo mv piqttermtcp.desktop /usr/share/applications/
}
##################################
# Security Tools
##################################
SECURITY(){
cd $HOME/bin
wget https://raw.githubusercontent.com/km4ack/pi-scripts/master/security-tools
bash security-tools
SECURITY() {
cd ${HOME}/bin || exit
wget https://raw.githubusercontent.com/km4ack/pi-scripts/master/security-tools
bash security-tools
sudo mv $HOME/bin/securefile /usr/local/bin
sudo mv ${HOME}/bin/securefile /usr/local/bin
cat > secure-file.desktop <<EOF
cat >secure-file.desktop <<EOF
[Desktop Entry]
Name=SSE File Encryptor
GenericName=SSE File Encryptor
@ -262,104 +254,103 @@ Type=Application
Categories=Utility
EOF
sudo mv secure-file.desktop /usr/share/applications/
sudo mv secure-file.desktop /usr/share/applications/
}
##################################
# YGATE
##################################
YGATE(){
cd $HOME/bin
wget https://raw.githubusercontent.com/craigerl/ygate/master/ygate.py
chmod +x ygate.py
YGATE() {
cd ${HOME}/bin || exit
wget https://raw.githubusercontent.com/craigerl/ygate/master/ygate.py
chmod +x ygate.py
cat > ygate.desktop <<EOF
cat >ygate.desktop <<EOF
[Desktop Entry]
Name=YGATE
GenericName=YGATE
Comment=Yaesu APRS Application
Exec=$HOME/bin/ygate.py
Exec=${HOME}/bin/ygate.py
Terminal=true
Type=Application
Categories=Utility
EOF
sudo mv ygate.desktop /usr/share/applications/
sudo mv ygate.desktop /usr/share/applications/
}
##################################
# BPQ
##################################
BPQ(){
source $HOME/pi-build/config
#install LinBPQ
cd
##########################################################################
#commands below this line were taken from John Wiseman's install script.
#and modded to pull the operators call sign from the BAP config file.
#http://www.cantab.net/users/john.wiseman/Downloads/installLinRMS
##########################################################################
export LINBPQ=pilinbpq;
export APRS=piBPQAPRS
echo "Downloading $LINBPQ and $APRS to linbpq and bpqaprs"
BPQ() {
source ${HOME}/pi-build/config || exit
#install LinBPQ
cd || exit
##########################################################################
#commands below this line were taken from John Wiseman's install script.
#and modded to pull the operators call sign from the BAP config file.
#http://www.cantab.net/users/john.wiseman/Downloads/installLinRMS
##########################################################################
export LINBPQ=pilinbpq
export APRS=piBPQAPRS
echo "Downloading ${LINBPQ} and ${APRS} to linbpq and bpqaprs"
mkdir linbpq
cd linbpq
wget -nv http://www.cantab.net/users/john.wiseman/Downloads/Beta/$LINBPQ -O linbpq
chmod +x linbpq
wget -nv http://www.cantab.net/users/john.wiseman/Downloads/Beta/$APRS -O bpqaprs
chmod +x bpqaprs
mkdir linbpq
cd linbpq || exit
wget -nv http://www.cantab.net/users/john.wiseman/Downloads/Beta/${LINBPQ} -O linbpq
chmod +x linbpq
wget -nv http://www.cantab.net/users/john.wiseman/Downloads/Beta/${APRS} -O bpqaprs
chmod +x bpqaprs
echo "Downloading config files"
echo "Downloading config files"
wget -nv http://www.cantab.net/users/john.wiseman/Downloads/SimpleRMSGateway_bpq32.cfg -O bpq32.cfg
wget -nv http://www.cantab.net/users/john.wiseman/Downloads/SimpleRMSGateway_bpq32.cfg -O bpq32.cfg
echo "Downloading HTML Files"
echo "Downloading HTML Files"
mkdir HTML
cd HTML
wget -nv http://www.cantab.net/users/john.wiseman/Downloads/Beta/HTMLPages.zip
unzip -o -q HTMLPages.zip
rm HTMLPages.zip
cd ..
wget -nv http://www.cantab.net/users/john.wiseman/Downloads/LinBPQAPRS.zip
unzip -o -q LinBPQAPRS.zip
rm LinBPQAPRS.zip
mkdir HTML
cd HTML || exit
wget -nv http://www.cantab.net/users/john.wiseman/Downloads/Beta/HTMLPages.zip
unzip -o -q HTMLPages.zip
rm HTMLPages.zip
cd .. || exit
wget -nv http://www.cantab.net/users/john.wiseman/Downloads/LinBPQAPRS.zip
unzip -o -q LinBPQAPRS.zip
rm LinBPQAPRS.zip
echo "Updating your callsign in configuration files"
echo "Updating your callsign in configuration files"
#read -e -p "Enter Your Callsign (Without SSID): " CALL
CALL=$(echo "$CALL" | tr '[:lower:]' '[:upper:]')
#read -e -p "Enter Your Callsign (Without SSID): " CALL
CALL=$(echo "$CALL" | tr '[:lower:]' '[:upper:]')
sed -i "s/MYCALL/$CALL/g" bpq32.cfg
sed -i "s/MYCALL/$CALL/g" bpq32.cfg
#####################################################
#End John Wiseman install script
#####################################################
#install BPQ config generator
cd $HOME/linbpq
wget https://www.cantab.net/users/john.wiseman/Downloads/Beta/piBPQConfigGen
chmod +x piBPQConfigGen
#####################################################
#End John Wiseman install script
#####################################################
#install BPQ config generator
cd ${HOME}/linbpq || exit
wget https://www.cantab.net/users/john.wiseman/Downloads/Beta/piBPQConfigGen
chmod +x piBPQConfigGen
cat > bpq-config.desktop <<EOF
cat >bpq-config.desktop <<EOF
[Desktop Entry]
Name=BPQ Config Generator
GenericName=BPQ Config Generator
Comment=Config File Generator for LinBPQ
Exec=$HOME/linbpq/piBPQConfigGen
Exec=${HOME}/linbpq/piBPQConfigGen
Terminal=false
Type=Application
Categories=Utility
EOF
sudo mv bpq-config.desktop /usr/share/applications/
sudo mv bpq-config.desktop /usr/share/applications/
#add LinBPQ-README to desktop
FILE=$HOME/Desktop/LinBPQ-README
touch $FILE
cat << EOF > $FILE
#add LinBPQ-README to desktop
FILE=${HOME}/Desktop/LinBPQ-README
touch ${FILE}
cat <<EOF >${FILE}
LinBPQ was installed during the build.
You will find the config file generator
under accessories in the main pi menu.
@ -372,7 +363,7 @@ After completing the config file, you can
start LinBPQ from the command line by running:
~/linbpq/.linbpq
Depending on your station setup, you may
Depending on your station setup, you may
need to start rig control, direwolf, or
other applications before running LinBPQ.
@ -388,89 +379,89 @@ EOF
##################################
# Battery Test Script
##################################
BATT(){
cd $HOME/bin
wget https://raw.githubusercontent.com/km4ack/pi-scripts/master/batt-test
chmod +x batt-test
BATT() {
cd ${HOME}/bin || exit
wget https://raw.githubusercontent.com/km4ack/pi-scripts/master/batt-test
chmod +x batt-test
cat > battery-test.desktop <<EOF
cat >battery-test.desktop <<EOF
[Desktop Entry]
Name=Battery Test Script
GenericName=Battery Test Script
Comment=Battery Test Utility
Exec=$HOME/bin/batt-test
Exec=${HOME}/bin/batt-test
Terminal=true
Type=Application
Categories=Utility
EOF
sudo mv battery-test.desktop /usr/share/applications/
sudo mv battery-test.desktop /usr/share/applications/
}
##################################
# VNC Viewer
##################################
VNC(){
cd $HOME
PACKAGE=$(curl -s https://www.realvnc.com/en/connect/download/viewer/raspberrypi/ | grep .deb | awk '{print $2}' | \
sed 's/href="\/download\/file\/viewer.files\///' | sed 's/"//')
VNC() {
cd ${HOME} || exit
PACKAGE=$(curl -s https://www.realvnc.com/en/connect/download/viewer/raspberrypi/ | grep .deb | awk '{print $2}' |
sed 's/href="\/download\/file\/viewer.files\///' | sed 's/"//')
wget https://realvnc.com/download/file/viewer.files/$PACKAGE
sudo dpkg -i $PACKAGE
rm $PACKAGE
wget https://realvnc.com/download/file/viewer.files/${PACKAGE}
sudo dpkg -i ${PACKAGE}
rm ${PACKAGE}
}
##################################
# ZYGRIB Viewer
##################################
ZYGRIB(){
sudo apt install -y zygrib
sudo apt install -y zygrib-maps
ZYGRIB() {
sudo apt install -y zygrib
sudo apt install -y zygrib-maps
}
##################################
# GPS update tool
##################################
GPSUPDATE(){
#remove existing file if needed before installing
if [ -f $HOME/bin/gpsupdate ]; then
rm $HOME/bin/gpsupdate
fi
GPSUPDATE() {
#remove existing file if needed before installing
if [ -f ${HOME}/bin/gpsupdate ]; then
rm ${HOME}/bin/gpsupdate
fi
cd $HOME/bin
wget https://raw.githubusercontent.com/km4ack/pi-scripts/master/gpsupdate
chmod +x gpsupdate
cd ${HOME}/bin || exit
wget https://raw.githubusercontent.com/km4ack/pi-scripts/master/gpsupdate
chmod +x gpsupdate
cat > gpsupdate.desktop <<EOF
cat >gpsupdate.desktop <<EOF
[Desktop Entry]
Name=GPS Update Tool
GenericName=Used to change between GPS units
Comment=Used to change between GPS units
Exec=$HOME/bin/gpsupdate
Exec=${HOME}/bin/gpsupdate
Terminal=false
Type=Application
Categories=Utility
EOF
sudo mv gpsupdate.desktop /usr/share/applications/
sudo mv gpsupdate.desktop /usr/share/applications/
}
##################################
# removeMS Tool
##################################
REMOVEMS(){
#download the file
cd $HOME/bin
wget https://raw.githubusercontent.com/km4ack/pi-scripts/master/removeMS
chmod +x $HOME/bin/removeMS
#place user directions on desktop
cat <<EOF>$HOME/Desktop/Block-Microsoft.txt
REMOVEMS() {
#download the file
cd ${HOME}/bin || exit
wget https://raw.githubusercontent.com/km4ack/pi-scripts/master/removeMS
chmod +x ${HOME}/bin/removeMS
#place user directions on desktop
cat <<EOF >${HOME}/Desktop/Block-Microsoft.txt
You have chosen to install the removeMS
script which will block the Pi from accessing
the Microsoft repository. The block has not
been applied yet. To apply the block, open a
been applied yet. To apply the block, open a
terminal window and run the following command:
removeMS
@ -485,4 +476,3 @@ More information is available in this video
https://youtu.be/I7jLVgnnUW0
EOF
}

1751
update

Plik diff jest za duży Load Diff