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

164
.funfacts
Wyświetl plik

@ -1,151 +1,123 @@
#!/bin/bash #!/bin/bash
#20200515 km4ack #20200515 km4ack
MYPATH="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" MYPATH="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)"
LOGO=$MYPATH/logo.png 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 \ 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 \ --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 \
When he released his first video, he had never written a bash script" 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 \ 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 \ --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." 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 \ 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 \ --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" 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 \ 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 \ --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" 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 \ 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 \ --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" 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 \ 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 \ --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" 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 \ 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 \ --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" 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 \ 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 \ --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" 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 \ 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 \ --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" 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 \ 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 \ --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" 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 \ 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 \ --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" 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 \ 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 \ --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" 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 \ 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 \ --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" 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 \ 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 \ --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" 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 \ 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 \ --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" 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 \ 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 \ --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>" 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 \ 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 \ --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!!" 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 \ 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 \ --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" 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 \ 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 \ --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" 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 \ 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 \ --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." 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 \ 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 \ --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" 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 \ 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 \ --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" 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 \ 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 \ --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" 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 \ 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 \ --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" 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 \ 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 \ --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 \ 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" 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 \ 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 \ --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" 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 \ 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 \ --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" 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 \ 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 \ --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" Enough about KM4ACK! Go grab a coffee or do something fun while your pi is built"

Wyświetl plik

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

Wyświetl plik

@ -4,240 +4,236 @@
#to help diagnose issues #to help diagnose issues
#20200616 km4ack #20200616 km4ack
#11FEB2021 review km4ack #11FEB2021 review km4ack
clear;echo;echo clear
read -p "What is your call sign? " CALL echo
echo
DIR=$HOME/Desktop/$CALL-diagnostic-report read -rp "What is your call sign? " CALL
DIR=${HOME}/Desktop/${CALL}-diagnostic-report
#create temp dir #create temp dir
mkdir -p $DIR mkdir -p ${DIR}
#check to see which apps are installed #check to see which apps are installed
CHECK(){ CHECK() {
#----------------------------------------------------# #----------------------------------------------------#
# Hotspot # Hotspot
#----------------------------------------------------# #----------------------------------------------------#
HOTSPOT="/usr/bin/autohotspotN" HOTSPOT="/usr/bin/autohotspotN"
if [ ! -f "$HOTSPOT" ]; then if [ ! -f "${HOTSPOT}" ]; then
HOTSPOT="Not Installed" 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
else else
RIG="is_latest_version" HOTSPOT="Installed"
fi fi
fi
#----------------------------------------------------# #----------------------------------------------------#
# FLRIG # AX25
#----------------------------------------------------# #----------------------------------------------------#
echo "Checking FLRIG" if [ ! -d /etc/ax25 ]; then
if ! hash flrig 2>/dev/null; then AX25="Not Installed"
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 else
FLRIG="is_latest_version" AX25="Installed"
fi fi
fi #----------------------------------------------------#
# GPS
#----------------------------------------------------# #----------------------------------------------------#
# Pat Winlink if ! hash gpsd 2>/dev/null; then
#----------------------------------------------------# GPS="Not Installed"
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 else
PAT="is_latest_version" GPS="Installed"
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
fi #----------------------------------------------------#
#----------------------------------------------------# # PULSE
# Pat Menu #----------------------------------------------------#
#----------------------------------------------------# if ! hash pulseaudio 2>/dev/null; then
echo "Checking Pat Menu" PULSE="Not Installed"
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"
else else
PATMENU="is_latest_version" PULSE="Installed"
fi fi
fi #----------------------------------------------------#
# ARDOP
#----------------------------------------------------# #----------------------------------------------------#
# Hot Spot Tools if [ -f ${HOME}/ardop/piardopc ]; then
#----------------------------------------------------# ARDOP="Installed"
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 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
fi
#----------------------------------------------------# #----------------------------------------------------#
# EES # RIG CONTROL - HAMLIB
#----------------------------------------------------# #----------------------------------------------------#
if [ -f /var/www/html/email.php ]; then if ! hash rigctl 2>/dev/null; then
EES="Installed" RIG="Not_Installed"
else else
EES="Not Installed" echo "Checking Rig Control"
fi 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
# CONKY RIG=NEEDS-UPDATE
#----------------------------------------------------# else
if [ -f $HOME/.conkyrc ]; then RIG="is_latest_version"
CONKY=Installed fi
else fi
CONKY="Not Installed"
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 CHECK
#get system info #get system info
WHO=$(whoami) WHO=$(whoami)
KERNAL=$(uname -r) KERNAL=$(uname -r)
echo "User Name is $WHO" > $DIR/systeminfo.txt echo "User Name is ${WHO}" >${DIR}/systeminfo.txt
echo "" >> $DIR/systeminfo.txt echo "" >>${DIR}/systeminfo.txt
echo "Kernal version is $KERNAL" >> $DIR/systeminfo.txt echo "Kernal version is ${KERNAL}" >>${DIR}/systeminfo.txt
echo "" >> $DIR/systeminfo.txt echo "" >>${DIR}/systeminfo.txt
cat /etc/os-release >> $DIR/systeminfo.txt cat /etc/os-release >>${DIR}/systeminfo.txt
echo;echo;echo "#####uname######" >> $DIR/systeminfo.txt echo
uname -a >> $DIR/systeminfo.txt echo
echo "#####uname######" >>${DIR}/systeminfo.txt
uname -a >>${DIR}/systeminfo.txt
#get direwolf.conf file #get direwolf.conf file
cat $HOME/direwolf.conf > $DIR/direwolf.conf cat ${HOME}/direwolf.conf >${DIR}/direwolf.conf
#get pat config file #get pat config file
cat $HOME/.wl2k/config.json > $DIR/patconfig.txt cat ${HOME}/.wl2k/config.json >${DIR}/patconfig.txt
#remove winlink password #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 #get pat menu config file
cat $HOME/patmenu2/config > $DIR/patmenu.conf cat ${HOME}/patmenu2/config >${DIR}/patmenu.conf
#Get wpa_supplicant #Get wpa_supplicant
sudo cat /etc/wpa_supplicant/wpa_supplicant.conf > $DIR/wpa.txt sudo cat /etc/wpa_supplicant/wpa_supplicant.conf >${DIR}/wpa.txt
sed -i 's/psk=.*$/PASSWORD-REMOVED/' $DIR/wpa.txt sed -i 's/psk=.*$/PASSWORD-REMOVED/' ${DIR}/wpa.txt
#get sound info #get sound info
echo "" >> $DIR/sound.info echo "" >>${DIR}/sound.info
echo "ARECORD INFO" > $DIR/sound.info echo "ARECORD INFO" >${DIR}/sound.info
arecord -l >> $DIR/sound.info arecord -l >>${DIR}/sound.info
echo "" >> $DIR/sound.info echo "" >>${DIR}/sound.info
echo "" >> $DIR/sound.info echo "" >>${DIR}/sound.info
echo "APLAY INFO" >> $DIR/sound.info echo "APLAY INFO" >>${DIR}/sound.info
aplay -l >> $DIR/sound.info aplay -l >>${DIR}/sound.info
echo "" >> $DIR/sound.info echo "" >>${DIR}/sound.info
echo "" >> $DIR/sound.info echo "" >>${DIR}/sound.info
echo "Using sound card" >> $DIR/sound.info echo "Using sound card" >>${DIR}/sound.info
sudo lsof /dev/snd/* >> $DIR/sound.info sudo lsof /dev/snd/* >>${DIR}/sound.info
#Get hotspot info #Get hotspot info
HS=$(systemctl is-active autohotspot) 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) CHECK=$(ls /etc/wpa_supplicant/ | grep FORCE)
AUTORUN=$(crontab -l | grep autohotspotN | awk '{print $1}' | sed 's/*\///') AUTORUN=$(crontab -l | grep autohotspotN | awk '{print $1}' | sed 's/*\///')
if [ -z "$CHECK" ]; then if [ -z "$CHECK" ]; then
FORCE="Hotspot Not in force mode" FORCE="Hotspot Not in force mode"
else else
FORCE="Hotspot IS in force mode" FORCE="Hotspot IS in force mode"
fi fi
if [ $HSS = $CIP ] if [ ${HSS} = ${CIP} ]; then
then HSS=ACTIVE
HSS=ACTIVE
else else
HSS=INACTIVE HSS=INACTIVE
fi fi
FILE=$DIR/hotspot.info FILE=${DIR}/hotspot.info
echo "Hotspot status $HS" > $FILE echo "Hotspot status ${HS}" >${FILE}
echo "Hotspot state $HSS" >> $FILE echo "Hotspot state ${HSS}" >>${FILE}
echo "Hotspot Name is $CURRENTNAME" >> $FILE echo "Hotspot Name is ${CURRENTNAME}" >>${FILE}
echo "Hotspot IP = $HSIP" >> $FILE echo "Hotspot IP = ${HSIP}" >>${FILE}
echo "Wireless IP = $CIP" >> $FILE echo "Wireless IP = ${CIP}" >>${FILE}
echo "CAT5 IP = $WIREIP" >> $FILE echo "CAT5 IP = ${WIREIP}" >>${FILE}
echo "$FORCE" >> $FILE echo "${FORCE}" >>${FILE}
echo "crontab set to auto run ever $AUTORUN minutes" >> $FILE echo "crontab set to auto run ever ${AUTORUN} minutes" >>${FILE}
#get cron contents #get cron contents
crontab -l > $DIR/cron.txt crontab -l >${DIR}/cron.txt
#get gps info #get gps info
GPSD=$(systemctl is-active gpsd) GPSD=$(systemctl is-active gpsd)
CHRONY=$(systemctl is-active chronyd) CHRONY=$(systemctl is-active chronyd)
echo "/etc/default/gpsd file contents" > $DIR/gps.info echo "/etc/default/gpsd file contents" >${DIR}/gps.info
echo;echo >> $DIR/gps.info echo
cat /etc/default/gpsd >> $DIR/gps.info echo >>${DIR}/gps.info
echo;echo;echo >> $DIR/gps.info cat /etc/default/gpsd >>${DIR}/gps.info
echo "GPSD is $GPSD" >> $DIR/gps.info echo
echo "Chrony is $CHRONY" >> $DIR/gps.info echo
echo;echo;echo "#####TIME SOURCES#####" >> $DIR/gps.info echo >>${DIR}/gps.info
chronyc sources -v >> $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 #Check installed apps
echo "Hotspot $HOTSPOT" > $DIR/apps.info echo "Hotspot $HOTSPOT" >${DIR}/apps.info
echo "HS Tools $HSTOOLS" >> $DIR/apps.info echo "HS Tools $HSTOOLS" >>${DIR}/apps.info
echo "AX25 $AX25" >> $DIR/apps.info echo "AX25 $AX25" >>${DIR}/apps.info
echo "GPS $GPS" >> $DIR/apps.info echo "GPS $GPS" >>${DIR}/apps.info
echo "Pulse $PULSE" >> $DIR/apps.info echo "Pulse $PULSE" >>${DIR}/apps.info
echo "ARDOP GUI $ARDOPGUI" >> $DIR/apps.info echo "ARDOP GUI $ARDOPGUI" >>${DIR}/apps.info
echo "CONKY $CONKY" >> $DIR/apps.info echo "CONKY $CONKY" >>${DIR}/apps.info
echo "HAMLIB $RIG" >> $DIR/apps.info echo "HAMLIB $RIG" >>${DIR}/apps.info
echo "FLRIG $FLRIG" >> $DIR/apps.info echo "FLRIG $FLRIG" >>${DIR}/apps.info
echo "PAT $PAT" >> $DIR/apps.info echo "PAT $PAT" >>${DIR}/apps.info
echo "DIREWOLF $DIRE" >> $DIR/apps.info echo "DIREWOLF $DIRE" >>${DIR}/apps.info
echo "Pat Menu $PATMENU" >> $DIR/apps.info echo "Pat Menu $PATMENU" >>${DIR}/apps.info
echo "EES $EES" >> $DIR/apps.info echo "EES $EES" >>${DIR}/apps.info
cd $HOME/Desktop cd ${HOME}/Desktop || exit
zip -r $CALL-diagnostic.zip $DIR > /dev/null 2>&1 zip -r ${CALL}-diagnostic.zip ${DIR} >/dev/null 2>&1
rm -rf $DIR > /dev/null 2>&1 rm -rf ${DIR} >/dev/null 2>&1
clear;echo;echo clear
echo
echo
cat <<EOF cat <<EOF
DONE!! 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 to km4ack@arrl.net along with a description of your issue
and a link to the original forum post. 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. benefit the community at large.
https://groups.io/g/KM4ACK-Pi/topics https://groups.io/g/KM4ACK-Pi/topics
73, de KM4ACK 73, de KM4ACK
EOF EOF

Wyświetl plik

@ -1,147 +1,144 @@
#additional software to install with build-a-pi #additional software to install with build-a-pi
#20200513 km4ack #20200513 km4ack
TEMPCRON=$MYPATH/cron.tmp TEMPCRON=${MYPATH}/cron.tmp
DIR=$MYPATH/temp DIR=${MYPATH}/temp
WHO=$(whoami) WHO=$(whoami)
mkdir -p $DIR mkdir -p ${DIR}
source ${MYPATH}/config
source $MYPATH/config
################################## ##################################
# PAT WINLINK # PAT WINLINK
################################## ##################################
PAT(){ PAT() {
echo "##################" echo "##################"
echo "installing pat" echo "installing pat"
echo "##################" echo "##################"
PORT=8080 PORT=8080
cd $DIR cd ${DIR}
if [ -f $HOME/.wl2k/config.json ]; then if [ -f ${HOME}/.wl2k/config.json ]; then
cp $HOME/.wl2k/config.json $DIR/config.json cp ${HOME}/.wl2k/config.json ${DIR}/config.json
fi fi
NEWPATV=$(curl -s https://github.com/la5nta/pat/releases | grep armhf | head -1 | sed 's/.*pat_/pat_/' | sed 's/<\/a>.*$//') 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\.//') NEWPAT=$(echo ${NEWPATV} | sed 's/pat_//' | sed 's/_linux_armhf.deb//' | sed 's/0\.//')
echo "new pat v $NEWPATV" echo "new pat v ${NEWPATV}"
echo "new pat $NEWPAT" echo "new pat ${NEWPAT}"
wget --tries 2 --connect-timeout=60 https://github.com/la5nta/pat/releases/download/v0.$NEWPAT/$NEWPATV wget --tries 2 --connect-timeout=60 https://github.com/la5nta/pat/releases/download/v0.${NEWPAT}/${NEWPATV}
sudo dpkg -i $DIR/$NEWPATV sudo dpkg -i ${DIR}/${NEWPATV}
pat http & pat http &
sudo killall pat sudo killall pat
sudo systemctl start pat@$WHO sudo systemctl start pat@${WHO}
sudo systemctl enable pat@$WHO sudo systemctl enable pat@${WHO}
cd $DIR cd ${DIR}
FIG=$HOME/.wl2k/config.json FIG=${HOME}/.wl2k/config.json
#set callsign #set callsign
sed -i "s/\"mycall\": \".*\",/\"mycall\": \"$CALL\",/" $FIG sed -i "s/\"mycall\": \".*\",/\"mycall\": \"${CALL}\",/" ${FIG}
#set password #set password
WL2KPASS=$(grep "WL2KPASS" $MYPATH/config | sed 's/"//g' | sed 's/WL2KPASS=//') WL2KPASS=$(grep "WL2KPASS" ${MYPATH}/config | sed 's/"//g' | sed 's/WL2KPASS=//')
sed -i "s/\"secure_login_password\": \".*\",/\"secure_login_password\": \""$WL2KPASS"\",/" $FIG sed -i "s/\"secure_login_password\": \".*\",/\"secure_login_password\": \""$WL2KPASS"\",/" ${FIG}
#set locator #set locator
sed -i "s/\"locator\": \".*\",/\"locator\": \"$GRID\",/" $FIG sed -i "s/\"locator\": \".*\",/\"locator\": \"$GRID\",/" ${FIG}
#Change localhost to 0.0.0.0 #Change localhost to 0.0.0.0
sed -i "s/\"http_addr\": \".*\",/\"http_addr\": \"0.0.0.0:$PORT\",/" $FIG 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 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 mv ${HOME}/Desktop/config.json ${FIG}
sed -i 's/"enable_http": false,/"enable_http": true,/' $FIG sed -i 's/"enable_http": false,/"enable_http": true,/' ${FIG}
if [ -f $DIR/config.json ]; then if [ -f ${DIR}/config.json ]; then
mv $DIR/config.json $HOME/.wl2k/ mv ${DIR}/config.json ${HOME}/.wl2k/
fi fi
} }
################################## ##################################
# PAT MENU # PAT MENU
################################## ##################################
PAT-MENU(){ PAT-MENU() {
#backup config files (Issue #119) #backup config files (Issue #119)
if [ -f $HOME/patmenu2/config ]; then if [ -f ${HOME}/patmenu2/config ]; then
mkdir -p $DIR/patconfig mkdir -p ${DIR}/patconfig
cp $HOME/patmenu2/*config* $DIR/patconfig/ cp ${HOME}/patmenu2/*config* ${DIR}/patconfig/
fi fi
#update pat menu #update pat menu
if [ -d $HOME/patmenu2 ]; then if [ -d ${HOME}/patmenu2 ]; then
rm -rf $HOME/patmenu2 rm -rf "${HOME}/patmenu2"
fi fi
cd $HOME cd ${HOME}
git clone https://github.com/km4ack/patmenu2.git $HOME/patmenu2 && bash $HOME/patmenu2/setup 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/N0CALL/${CALL}/" ${HOME}/patmenu2/config
sed -i 's/1,0/2,0/g' $HOME/patmenu2/config sed -i 's/1,0/2,0/g' ${HOME}/patmenu2/config
#restore config files #restore config files
if [ -d $DIR/patconfig/ ]; then if [ -d ${DIR}/patconfig/ ]; then
mv $DIR/patconfig/* $HOME/patmenu2/ mv ${DIR}/patconfig/* ${HOME}/patmenu2/
fi fi
} }
################################## ##################################
# JS8Call # JS8Call
################################## ##################################
JS8CALL(){ JS8CALL() {
cd $DIR cd ${DIR}
JS8LATE=$(curl -s http://files.js8call.com/latest.html | grep armhf | awk '{ print $2 }' | sed 's/href=//' | sed 's/"//g') 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/"//') 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 wget --tries 2 --connect-timeout=60 ${JS8LATE} || echo "Can't Download JS8Call" >>${BUILDLOG}
sudo dpkg -i $JS8PKG sudo dpkg -i ${JS8PKG}
sudo apt-get --fix-broken -y install sudo apt-get --fix-broken -y install
sudo dpkg -i $JS8PKG sudo dpkg -i ${JS8PKG}
} }
################################## ##################################
# WSJTX # WSJTX
################################## ##################################
WSJTX(){ WSJTX() {
cd $DIR 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) 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 wget --tries 2 --connect-timeout=60 --no-check-certificate https://physics.princeton.edu/pulsar/k1jt/$WSPKG
WSJTXSUCCESS=$? WSJTXSUCCESS=$?
sudo dpkg -i $WSPKG sudo dpkg -i $WSPKG
sudo apt-get --fix-broken -y install
sudo dpkg -i $WSPKG
#added to fix WSJTX 2.3.0
sudo sed -i "s/# en_US.UTF-8/en_US.UTF-8/g" /etc/locale.gen
sudo locale-gen
#end edit for WSJTX 2.3.0
#try sourcegorge if princeton.edu fails
WSJTX2(){
if [ "$WSJTXSUCCESS" ! = 0 ]; then
cd $DIR
wget --tries 2 --connect-timeout=60 https://sourceforge.net/projects/wsjt/files/wsjtx-2.2.2/wsjtx_2.2.2_armhf.deb
sudo dpkg -i wsjtx_2.2.2_armhf.deb
sudo apt-get --fix-broken -y install sudo apt-get --fix-broken -y install
sudo dpkg -i wsjtx_2.2.2_armhf.deb sudo dpkg -i $WSPKG
fi #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 WSJTX2
} }
################################## ##################################
# CONKY # CONKY
################################## ##################################
CONKY(){ CONKY() {
if ! hash conky 2>/dev/null; then if ! hash conky 2>/dev/null; then
sudo apt install -y conky sudo apt install -y conky
fi fi
touch $HOME/Documents/mylog.txt #conky will fail to load if this file doesn't exist 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 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 apt-get install -y ruby2.5
sudo gem install gpsd_client sudo gem install gpsd_client
sudo gem install maidenhead sudo gem install maidenhead
cp $MYPATH/conky/.conkyrc $HOME/.conkyrc cp ${MYPATH}/conky/.conkyrc ${HOME}/.conkyrc
mkdir -p $HOME/bin/conky mkdir -p ${HOME}/bin/conky
cp $MYPATH/conky/* $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 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 sed -i "s/N0CALL/${CALL}/" ${HOME}/.conkyrc
#Line below is for https://github.com/km4ack/pi-build/issues/198 #Line below is for https://github.com/km4ack/pi-build/issues/198
echo "#Update GPS maidenhead for conky" >> $TEMPCRON echo "#Update GPS maidenhead for conky" >>${TEMPCRON}
echo "*/1 * * * * /home/pi/bin/conky/grid" >> $TEMPCRON echo "*/1 * * * * /home/pi/bin/conky/grid" >>${TEMPCRON}
#Create files needed for autostart at login #Create files needed for autostart at login
#Fix issue https://github.com/km4ack/pi-build/issues/83 #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] [Desktop Entry]
Name=Conky Name=Conky
Comment=Conky Comment=Conky
@ -155,12 +152,12 @@ Categories=HamRadio
Keywords=Radio Keywords=Radio
EOF 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 #####Add setconky to main menu
chmod +x $HOME/pi-build/conky/setconky 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] [Desktop Entry]
Name=Conky-Prefs Name=Conky-Prefs
Comment=Conky-Prefs Comment=Conky-Prefs
@ -179,15 +176,15 @@ EOF
################################## ##################################
# M0IAX Tools # M0IAX Tools
################################## ##################################
M0IAX(){ M0IAX() {
cd $DIR cd ${DIR} || exit
wget http://m0iax.com/wp-content/uploads/2020/08/JS8CallUtils_RaspberryPi.zip wget http://m0iax.com/wp-content/uploads/2020/08/JS8CallUtils_RaspberryPi.zip
unzip JS8CallUtils_RaspberryPi.zip unzip JS8CallUtils_RaspberryPi.zip
rm JS8CallUtils_RaspberryPi.zip rm JS8CallUtils_RaspberryPi.zip
chmod +x JS8CallUtils_v2 chmod +x JS8CallUtils_v2
sudo mv JS8CallUtils_v2 /usr/local/bin sudo mv JS8CallUtils_v2 /usr/local/bin
cat > m0iax.desktop <<EOF cat >m0iax.desktop <<EOF
[Desktop Entry] [Desktop Entry]
Name=M0IAX JS8 Utils Name=M0IAX JS8 Utils
GenericName=M0IAX JS8 Utils GenericName=M0IAX JS8 Utils
@ -198,41 +195,41 @@ Type=Application
Categories=Network;HamRadio; Categories=Network;HamRadio;
EOF EOF
sudo mv m0iax.desktop /usr/share/applications/ sudo mv m0iax.desktop /usr/share/applications/
} }
################################## ##################################
# PYQSO # PYQSO
################################## ##################################
PYQSO(){ PYQSO() {
sudo apt-get install -y pyqso sudo apt-get install -y pyqso
} }
################################## ##################################
# CQRLOG # CQRLOG
################################## ##################################
CQRLOG(){ CQRLOG() {
#sudo apt-get install -y 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 \ 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 \ 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 \ 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 \ 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 \ 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 \ 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 \ 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 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 cd
git clone https://github.com/ok2cqr/cqrlog.git git clone https://github.com/ok2cqr/cqrlog.git
cd cqrlog cd cqrlog
make make
sudo make install sudo make install
cd .. cd ..
rm -rf cqrlog rm -rf cqrlog
cat > cqrlog.desktop <<EOF cat >cqrlog.desktop <<EOF
[Desktop Entry] [Desktop Entry]
Name=CQRLOG Name=CQRLOG
Comment=Amateur Radio Logging Software Comment=Amateur Radio Logging Software
@ -244,183 +241,181 @@ Terminal=false
Categories=HamRadio;Utility Categories=HamRadio;Utility
EOF EOF
sudo mv cqrlog.desktop /usr/share/applications/ sudo mv cqrlog.desktop /usr/share/applications/
} }
################################## ##################################
# CHIRP # CHIRP
################################## ##################################
CHIRP(){ CHIRP() {
cd $DIR cd ${DIR} || exit
wget --tries 2 --connect-timeout=60 https://trac.chirp.danplanet.com/chirp_daily/LATEST/ 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/[<].*$//') 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 sudo apt-get -y install python-gtk2 python-serial python-libxml2
mkdir $HOME/chirp mkdir ${HOME}/chirp
cd $HOME/chirp cd ${HOME}/chirp || exit
wget --tries 2 --connect-timeout=60 https://trac.chirp.danplanet.com/chirp_daily/LATEST/$CHIRPBUILD wget --tries 2 --connect-timeout=60 https://trac.chirp.danplanet.com/chirp_daily/LATEST/$CHIRPBUILD
tar -xzf $CHIRPBUILD tar -xzf $CHIRPBUILD
CHIRPDIR=$(echo $CHIRPBUILD | sed 's/[.].*$//') CHIRPDIR=$(echo $CHIRPBUILD | sed 's/[.].*$//')
cd $CHIRPDIR cd $CHIRPDIR || exit
sudo python setup.py install sudo python setup.py install
pip install future pip install future
} }
################################## ##################################
# GARIM # GARIM
################################## ##################################
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/') 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 cd ${DIR} || exit
wget --tries 2 --connect-timeout=60 https://www.whitemesa.net/garim/src/$GPKG wget --tries 2 --connect-timeout=60 https://www.whitemesa.net/garim/src/$GPKG
tar -xzvf $GPKG tar -xzvf $GPKG
DIRR=$(echo $GPKG | sed 's/.tar.gz//') DIRR=$(echo $GPKG | sed 's/.tar.gz//')
cd $DIRR cd ${DIRR} || exit
./configure ./configure
make make
sudo make install sudo make install
} }
################################## ##################################
# QSSTV # QSSTV
################################## ##################################
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 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 #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) #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 #wget --tries 2 --connect-timeout=60 http://users.telenet.be/on4qz/qsstv/downloads/$TAR
#SSTVTAR=$(echo $TAR | sed 's/.tar.gz//;s/.0//') #SSTVTAR=$(echo $TAR | sed 's/.tar.gz//;s/.0//')
#tar -xvzf $TAR #tar -xvzf $TAR
#cd $SSTVTAR #cd $SSTVTAR || exit
#qmake #qmake
#make #make
#sudo make install #sudo make install
#hard code for 9.4.4 as temp wrokaround 02MARCH2021 #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 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 tar -xvzf qsstv_9.4.4.tar.gz
cd qsstv_9.4.4 cd qsstv_9.4.4 || exit
qmake qmake
make make
sudo make install 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
################################## ##################################
GRIDTRACKER(){ GRIDTRACKER() {
cd $HOME cd ${HOME} || exit
sudo apt-get install -y libgconf-2-4 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/') 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 wget --tries 2 --connect-timeout=60 $GRIDDLL
GRIDTAR=$(echo $GRIDDLL | sed 's/.*\///g') GRIDTAR=$(echo $GRIDDLL | sed 's/.*\///g')
tar -xzvf $GRIDTAR tar -xzvf $GRIDTAR
rm *.gz rm ./*.gz
cat > gridtracker.desktop <<EOF cat >gridtracker.desktop <<EOF
[Desktop Entry] [Desktop Entry]
Name=GridTracker Name=GridTracker
Comment=GridTracker Comment=GridTracker
GenericName=GridTracker, a WSJT-X Companion GenericName=GridTracker, a WSJT-X Companion
Exec=$HOME/GridTracker/GridTracker --disable-accelerated-2d-canvas --num-raster-threads=2 Exec=${HOME}/GridTracker/GridTracker --disable-accelerated-2d-canvas --num-raster-threads=2
Icon=$HOME/GridTracker/gridtracker.png Icon=${HOME}/GridTracker/gridtracker.png
Path=$HOME/GridTracker Path=${HOME}/GridTracker
Type=Application Type=Application
Encoding=UTF-8 Encoding=UTF-8
Terminal=false Terminal=false
Categories=HamRadio; Categories=HamRadio;
EOF EOF
sudo mv gridtracker.desktop /usr/share/applications/ sudo mv gridtracker.desktop /usr/share/applications/
} }
################################## ##################################
# PROPAGATION # PROPAGATION
################################## ##################################
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 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 #install primary program
cd $HOME/Downloads cd ${HOME}/Downloads || exit
wget --tries 2 --connect-timeout=60 https://www.qsl.net/hz1jw/voacapl/downloads/voacapl-0.7.2.tar.gz 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 tar -xzf voacapl-0.7.2.tar.gz
cd voacapl-0.7.2 cd voacapl-0.7.2 || exit
./configure ./configure
make make
sudo make install sudo make install
#install gui app for propagation reports #install gui app for propagation reports
cd $HOME/Downloads cd ${HOME}/Downloads
wget --tries 2 --connect-timeout=60 https://www.qsl.net/hz1jw/pythonprop/downloads/pythonprop-0.28.tar.gz 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 tar -xzf pythonprop-0.28.tar.gz
cd pythonprop-0.28 cd pythonprop-0.28
./configure ./configure
sudo make install sudo make install
$HOME/Downloads/voacapl-0.7.2/makeitshfbc ${HOME}/Downloads/voacapl-0.7.2/makeitshfbc
} }
################################## ##################################
# YAAC # YAAC
################################## ##################################
YAAC(){ YAAC() {
cd $DIR cd ${DIR} || exit
#wget --tries 2 --connect-timeout=60 https://sourceforge.net/projects/yetanotheraprsc/files/YAAC.zip/ #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 wget --tries 2 --connect-timeout=60 https://www.ka2ddo.org/ka2ddo/YAAC.zip
sudo apt-get install -y openjdk-8-jre librxtx-java sudo apt-get install -y openjdk-8-jre librxtx-java
mkdir -p $HOME/YAAC mkdir -p ${HOME}/YAAC
cd $HOME/YAAC cd ${HOME}/YAAC || exit
touch YAAC touch YAAC
echo "#!/bin/bash" >> YAAC echo "#!/bin/bash" >>YAAC
echo "java -jar $HOME/YAAC/YAAC.jar" >> YAAC echo "java -jar ${HOME}/YAAC/YAAC.jar" >>YAAC
chmod +x YAAC chmod +x YAAC
cat > yaac.desktop <<EOF cat >yaac.desktop <<EOF
[Desktop Entry] [Desktop Entry]
Name=YAAC Name=YAAC
GenericName=YAAC GenericName=YAAC
Comment=APRS Client Comment=APRS Client
Exec=$HOME/YAAC/YAAC Exec=${HOME}/YAAC/YAAC
Terminal=false Terminal=false
Type=Application Type=Application
Categories=Network;HamRadio; Categories=Network;HamRadio;
EOF EOF
sudo mv yaac.desktop /usr/share/applications/ sudo mv yaac.desktop /usr/share/applications/
unzip $DIR/YAAC.zip unzip ${DIR}/YAAC.zip
} }
################################## ##################################
# XASTIR # XASTIR
################################## ##################################
XASTIR(){ XASTIR() {
###OLD CODE ###OLD CODE
#sudo apt-get install -y xastir #sudo apt-get install -y xastir
#sudo chmod +x /usr/bin/xastir #sudo chmod +x /usr/bin/xastir
#sudo sed -i 's/Exec=xastir/Exec=sudo xastir/' /usr/share/applications/xastir.desktop #sudo sed -i 's/Exec=xastir/Exec=sudo xastir/' /usr/share/applications/xastir.desktop
###NEW CODE 29JAN2021 Builds from source ###NEW CODE 29JAN2021 Builds from source
sudo apt-get -y install build-essential automake git xorg-dev libmotif-dev graphicsmagick \ 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 \ 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 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 cat >xastir.desktop <<EOF
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
[Desktop Entry] [Desktop Entry]
Name=Xastir Name=Xastir
Comment=X Amateur Station Tracking and Information Reporting Comment=X Amateur Station Tracking and Information Reporting
@ -432,7 +427,7 @@ Categories=Network;HamRadio
Keywords=APRS;AX.25;HamRadio Keywords=APRS;AX.25;HamRadio
EOF 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 # KM4ACK EES
################################## ##################################
EES(){ EES() {
#install PHP7.3 if not installed #install PHP7.3 if not installed
#this will also install apache2 #this will also install apache2
if ! hash php7.3 2>/dev/null; then if ! hash php7.3 2>/dev/null; then
sudo apt install -y php7.3 sudo apt install -y php7.3
fi fi
#install ghostwriter if needed #install ghostwriter if needed
#this is used to mod the new index.html #this is used to mod the new index.html
#page. 20200229 #page. 20200229
if ! hash ghostwriter 2>/dev/null; then if ! hash ghostwriter 2>/dev/null; then
sudo apt-get install -y ghostwriter sudo apt-get install -y ghostwriter
fi fi
#Install the KM4ACK EES #Install the KM4ACK EES
cd $DIR cd ${DIR} || exit
git clone https://github.com/km4ack/EES-LITE.git git clone https://github.com/km4ack/EES-LITE.git
cd $DIR/EES-LITE cd ${DIR}/EES-LITE || exit
#git dev branch of code #git dev branch of code
git checkout dev git checkout dev
sudo cp -r $DIR/EES-LITE/* /var/www/html/ sudo cp -r ${DIR}/EES-LITE/* /var/www/html/
rm -rf $DIR/EES-LITE rm -rf "${DIR}/EES-LITE"
cd /var/www/html cd /var/www/html || exit
sudo chmod +x /var/www/html/firstrun sudo chmod +x /var/www/html/firstrun
sudo /var/www/html/./firstrun sudo /var/www/html/./firstrun
sudo sed -i "s/N0CALL/$CALL/" /var/www/html/config.php 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 sudo sed -i 's/REMINDER\ FOR\ OPERATOR\ TO\ DO\ SOMETHING/ENABLE\ AUTO\ POST\ REPLY\ IN\ CRON/' /var/www/html/config.php
cd $DIR cd ${DIR} || exit
#Change Pat Winlink port so it won't interfer with the EES #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/0.0.0.0:8080/0.0.0.0:5000/' ${HOME}/.wl2k/config.json
sed -i 's/PORT=8080/PORT=5000/' $HOME/patmenu2/config sed -i 's/PORT=8080/PORT=5000/' ${HOME}/patmenu2/config
sudo killall pat sudo killall pat
sudo systemctl start pat@$WHO 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
#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
################################## ##################################
PI-APRS(){ PI-APRS() {
cd $HOME cd ${HOME} || exit
git clone https://github.com/km4ack/Pi-APRS.git git clone https://github.com/km4ack/Pi-APRS.git
sudo cp ~/Pi-APRS/piaprs.desktop /usr/share/applications sudo cp ~/Pi-APRS/piaprs.desktop /usr/share/applications
} }
################################## ##################################
# HamClock Small # HamClock Small
################################## ##################################
SMALL(){ SMALL() {
sudo apt-get -y install make g++ libx11-dev sudo apt-get -y install make g++ libx11-dev
cd $DIR cd ${DIR} || exit
curl -o ESPHamClock.zip http://www.clearskyinstitute.com/ham/HamClock/ESPHamClock.zip curl -o ESPHamClock.zip http://www.clearskyinstitute.com/ham/HamClock/ESPHamClock.zip
unzip ESPHamClock.zip unzip ESPHamClock.zip
rm ESPHamClock.zip rm ESPHamClock.zip
cd ESPHamClock cd ESPHamClock || exit
sudo make -j 4 hamclock sudo make -j 4 hamclock
sudo chmod +s hamclock sudo chmod +s hamclock
sudo mv hamclock /usr/local/bin/hamclock sudo mv hamclock /usr/local/bin/hamclock
rm -rf $DIR/ESPHamClock rm -rf "${DIR}/ESPHamClock"
cat > $HOME/Downloads/hamclock.desktop <<EOF cat >${HOME}/Downloads/hamclock.desktop <<EOF
[Desktop Entry] [Desktop Entry]
Name=HamClock Name=HamClock
GenericName=Ham Clock GenericName=Ham Clock
@ -539,25 +531,25 @@ Type=Application
Categories=HamRadio; Categories=HamRadio;
EOF EOF
sudo mv $HOME/Downloads/hamclock.desktop /usr/share/applications/ sudo mv ${HOME}/Downloads/hamclock.desktop /usr/share/applications/
} }
################################## ##################################
# HamClock Large # HamClock Large
################################## ##################################
LARGE(){ LARGE() {
sudo apt-get -y install make g++ libx11-dev sudo apt-get -y install make g++ libx11-dev
cd $DIR cd ${DIR} || exit
curl -o ESPHamClock.zip http://www.clearskyinstitute.com/ham/HamClock/ESPHamClock.zip curl -o ESPHamClock.zip http://www.clearskyinstitute.com/ham/HamClock/ESPHamClock.zip
unzip ESPHamClock.zip unzip ESPHamClock.zip
rm ESPHamClock.zip rm ESPHamClock.zip
cd ESPHamClock cd ESPHamClock || exit
sudo make -j 4 hamclock-1600x960 sudo make -j 4 hamclock-1600x960
sudo chmod +s hamclock-1600x960 sudo chmod +s hamclock-1600x960
sudo mv hamclock-1600x960 /usr/local/bin/hamclock sudo mv hamclock-1600x960 /usr/local/bin/hamclock
rm -rf $DIR/ESPHamClock rm -rf "${DIR}/ESPHamClock"
cat > $HOME/Downloads/hamclock.desktop <<EOF cat >${HOME}/Downloads/hamclock.desktop <<EOF
[Desktop Entry] [Desktop Entry]
Name=HamClock Name=HamClock
GenericName=Ham Clock GenericName=Ham Clock
@ -569,69 +561,68 @@ Type=Application
Categories=HamRadio; Categories=HamRadio;
EOF EOF
sudo mv $HOME/Downloads/hamclock.desktop /usr/share/applications/ sudo mv ${HOME}/Downloads/hamclock.desktop /usr/share/applications/
} }
################################## ##################################
# Gpredict # Gpredict
################################## ##################################
GPREDICT(){ GPREDICT() {
sudo apt install -y gpredict sudo apt install -y gpredict
} }
################################## ##################################
# TQSL # TQSL
################################## ##################################
TQSL(){ TQSL() {
sudo apt install -y cmake g++ libexpat1-dev libssl-dev libdb++-dev libcurl4-openssl-dev libwxgtk3.0-dev sudo apt install -y cmake g++ libexpat1-dev libssl-dev libdb++-dev libcurl4-openssl-dev libwxgtk3.0-dev
cd $HOME cd ${HOME} || exit
CUR=$(curl -s http://www.arrl.org/tqsl-download | grep "for Linux" | sed 's/.*TQSL //' | awk '{print $1}') 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 wget http://www.arrl.org/tqsl/tqsl-${CUR}.tar.gz
tar -xzvf tqsl-$CUR.tar.gz tar -xzvf tqsl-${CUR}.tar.gz
rm tqsl-$CUR.tar.gz rm "tqsl-${CUR}.tar.gz"
cd tqsl-$CUR cd tqsl-${CUR} || exit
cmake . cmake .
make make
sudo make install sudo make install
sudo cp /home/pi/tqsl-$CUR/apps/tqsl.desktop /usr/share/applications/ sudo cp /home/pi/tqsl-${CUR}/apps/tqsl.desktop /usr/share/applications/
rm -rf $HOME/tqsl-$CUR rm -rf "${HOME}/tqsl-${CUR}"
} }
################################## ##################################
# XLOG # XLOG
################################## ##################################
XLOG(){ XLOG() {
#verify hamlib installed #verify hamlib installed
if ! hash rigctld 2>/dev/null; then if ! hash rigctld 2>/dev/null; then
cat <<EOF > $HOME/Desktop/XLOG.txt cat <<EOF >${HOME}/Desktop/XLOG.txt
Xlog could not be installed because hamlib Xlog could not be installed because hamlib
wasn't found on the system. Use the build wasn't found on the system. Use the build
a pi script to install hamlib and then try a pi script to install hamlib and then try
installing xlog again. installing xlog again.
EOF EOF
else else
TARXLOG=$(curl -s https://download.savannah.nongnu.org/releases/xlog/ | \ 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.*$//') 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 sudo apt-get install -y libgtkgl2.0-dev libusb-1.0-0-dev
wget https://download.savannah.nongnu.org/releases/xlog/$TARXLOG wget https://download.savannah.nongnu.org/releases/xlog/${TARXLOG}
tar -xzvf $TARXLOG tar -xzvf ${TARXLOG}
rm $TARXLOG rm ${TARXLOG}
cd $DIRXLOG cd ${DIR}XLOG || exit
./configure ./configure
make make
sudo make install sudo make install
cd $HOME cd ${HOME} || exit
rm -rf $DIRXLOG rm -rf "${DIR}XLOG"
fi fi
} }
################################## ##################################
@ -642,19 +633,17 @@ fi
#see https://github.com/km4ack/pi-build/issues/153 #see https://github.com/km4ack/pi-build/issues/153
#14OCT2020 KM4ACK #14OCT2020 KM4ACK
JTDX(){ JTDX() {
cd $HOME cd ${HOME}
#curl won't work here. Returns "forbidden" Use wget instead #curl won't work here. Returns "forbidden" Use wget instead
wget -qO jtdx.txt https://www.jtdx.tech/en/ 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\///') VER=$(grep armhf.deb jtdx.txt | awk '{print $2}' | sed 's/"//g' | sed 's/href=\/downloads\/Linux\///')
rm jtdx.txt rm jtdx.txt
wget https://www.jtdx.tech/downloads/Linux/$VER wget https://www.jtdx.tech/downloads/Linux/${VER}
sudo dpkg -i $VER sudo dpkg -i ${VER}
sudo apt-get --fix-broken -y install sudo apt-get --fix-broken -y install
sudo dpkg -i $VER sudo dpkg -i ${VER}
rm $VER rm ${VER}
} }

Wyświetl plik

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

Wyświetl plik

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

Wyświetl plik

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

Wyświetl plik

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

1751
update

Plik diff jest za duży Load Diff