Pull image icon locally instead of from the web each time.

This commit is contained in:
tb14
2019-12-20 20:38:50 -08:00
parent 1288720c72
commit c94807bc42
6 changed files with 84 additions and 39 deletions
+35 -20
View File
@@ -1,9 +1,9 @@
#!/bin/bash
################################################################################
################################################################################
####################### AmRRON Tri-Mode Setup v0.6 #########################
####################### AmRRON Tri-Mode Setup v0.6.1 #########################
####################### Created by TB-14 #########################
####################### 18 Aug 2019 #########################
####################### 20 Dec 2019 #########################
################################################################################
################################################################################
@@ -30,7 +30,7 @@ r="--height=${rows}"
function determine_os() {
#Deterimine computer type.
function noOS_Support() {
yad --image=/tmp/banner.png --center --no-buttons \
yad --image=$DIR/images/corps-icon.png --center --no-buttons \
--title "INVALID OS DETECTED" \
--text "A valid OS was not detected.\n\nThis installer was designed for \
Debian based distros; specifically Raspbian Stretch, Linux Mint 18.3 / 19.1 and Ubuntu 18.04." \
@@ -40,24 +40,39 @@ Debian based distros; specifically Raspbian Stretch, Linux Mint 18.3 / 19.1 and
}
function maybeOS_Support() {
if (yad --image=/tmp/banner.png --center \
if (yad --image=$DIR/images/corps-icon.png --center \
--title "Not Supported OS" \
--text "Your OS may be compatible with this installer but has not been \
tested.\n\nThis installer has been tested on Raspbian Stretch, Ubuntu \
18.04, and Mint 18.3 / 19.1.\n\nWould you like to continue anyway?" ${r} ${c}) then
yad --image=/tmp/banner.png --center \
yad --image=$DIR/images/corps-icon.png --center \
--title "Not Supported OS" \
--text "::: Did not detect perfectly supported OS but,\n\n \
::: Continuing installation at user's own risk..." ${r} ${c} ||
{ echo "exiting"; exit 1; }
else
yad --image=/tmp/banner.png --center \
yad --image=$DIR/images/corps-icon.png --center \
--title "Not Supported OS" \
--text "::: Exiting due to unsupported OS" ${r} ${c}
exit 1
fi
}
# Determine location user is running script from.
SOURCE="${BASH_SOURCE[0]}"
# While $SOURCE is a symlink, resolve it
while [ -h "$SOURCE" ]; do
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
SOURCE="$( readlink "$SOURCE" )"
# If $SOURCE was a relative symlink (so no "/" as prefix, need to
#resolve it relative to the symlink base directory
[[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE"
done
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
#echo "$DIR"
# Compatibility check for OS
# if lsb_release command is on their system
if hash lsb_release 2>/dev/null; then
@@ -119,7 +134,7 @@ fi
trap finish EXIT
#Lets grab the AmRRON Banner.
wget -N http://s9756.storage.proboards.com/5619756/a/KWTGc2YscxSclVEeB5jD.png -O /tmp/banner.png
#wget -N http://s9756.storage.proboards.com/5619756/a/KWTGc2YscxSclVEeB5jD.png -O /tmp/banner.png
##Some Variables used by more than one function
ARDOPSTATUS="/usr/local/bin/ardop-status"
@@ -323,19 +338,19 @@ sudo mv /tmp/ardop-status /usr/local/bin/ardop-status
function find_rig() {
RADIOMK=$(rigctl -l | awk '{print $2}' | awk '!x[$0]++' | grep -v "#" | tr '\n' ',')
CUSTOMRAD1=$(yad --center --wrap --title="Rigctl Setup" --text="Please answer the following selections:" \
--image=/tmp/banner.png \
--image=$DIR/images/corps-icon.png \
--form --separator="," --item-separator="," \
--field="Select Radio Make::CB" $RADIOMK ${c} ${r} | tr -d ,) || exit 1
RADIOMOD=$(rigctl -l | grep $CUSTOMRAD1 | awk '{print $3}' | tr '\n' ',')
CUSTOMRAD2=$(yad --center --wrap --title="Rigctl Setup" --text="Please answer the following selections:" \
--image=/tmp/banner.png \
--image=$DIR/images/corps-icon.png \
--form --separator="," --item-separator="," \
--field="Select Radio Model::CB" $RADIOMOD ${c} ${r} | tr -d ,) || exit 1
RADIOID=$(rigctl -l | grep $CUSTOMRAD2 | awk '{print $1}')
CUSTOMRAD3=$(yad --center --wrap --title="Rigctl Setup" --text="Please answer the following selections:" \
--image=/tmp/banner.png \
--image=$DIR/images/corps-icon.png \
--form --separator="," --item-separator="," \
--field="Rigctl Radio ID::CBE" $RADIOID \
--field="Tip::TXT" "Per your selections, this should be your Radio ID for rigctl. If you know it to be different, type the correct value instead." ${c} ${r}) || exit 1
@@ -349,7 +364,7 @@ RID=$(echo $CUSTOMRAD3 | awk -F "," '{print $1}')
function rigctl_setup() {
RIGCTLOPTIONS=$(yad --center --wrap --title="Rigctl Setup" --text="Please answer the following selections:" \
--image=/tmp/banner.png \
--image=$DIR/images/corps-icon.png \
--form --separator="," --item-separator="," \
--field="PTT Device::CBE" $RTSOPTIONS \
--field="Select Radio::CB" $RADIOS \
@@ -478,7 +493,7 @@ DEV=""
function rts_setup() {
DEV=$(yad --center --title="TriMode Setup" --text="Please answer the following selections:" \
--image=/tmp/banner.png \
--image=$DIR/images/corps-icon.png \
--form --separator="," --item-separator="," \
--field="PTT Device::CB" $RTSOPTIONS ${c} ${r}) || exit 1
@@ -491,7 +506,7 @@ function cat_setup() {
CATSEL=$(yad --center --title="TriMode Setup" --text="Please answer the following selections:" \
--image=/tmp/banner.png \
--image=$DIR/images/corps-icon.png \
--form --separator="," --item-separator="," \
--field="Select CAT device::CB" $RTSOPTIONS \
--field="Enter Baud Rate" "19200" \
@@ -573,9 +588,9 @@ SOCATRIGCTL="True"
function show_results() {
cat /etc/asound.conf | yad --center --text-info --image=/tmp/banner.png --wrap --title=TriMode --button="gtk-ok:0" --text="Your asound.conf file has been created with the following information." ${c} ${r}
cat /etc/asound.conf | yad --center --text-info --image=$DIR/images/corps-icon.png --wrap --title=TriMode --button="gtk-ok:0" --text="Your asound.conf file has been created with the following information." ${c} ${r}
awk 'NR==92 || NR==119 || NR==120' $ARDOPSTATUS | yad --center --text-info --image=/tmp/banner.png --wrap --title=TriMode --button="gtk-ok:0" --text="Your TNC Status launcher command has been modified to the following.." ${c} ${r}
awk 'NR==92 || NR==119 || NR==120' $ARDOPSTATUS | yad --center --text-info --image=$DIR/images/corps-icon.png --wrap --title=TriMode --button="gtk-ok:0" --text="Your TNC Status launcher command has been modified to the following.." ${c} ${r}
}
@@ -591,7 +606,7 @@ Procedure:
3. Enable RIGTLD and PAVUCONTROL, select Toggle. They should now have PID's listed.
4. You can now enable ARDOPC and ARDOP_GUI.
*NOTE* If you wish to use PAT you must first detach the TNC from ARIM before loading PAT." | yad --image=/tmp/banner.png \
*NOTE* If you wish to use PAT you must first detach the TNC from ARIM before loading PAT." | yad --image=$DIR/images/corps-icon.png \
--text-info --center --button="gtk-ok:0" \
--wrap \
--title "Complete" ${r} ${c}
@@ -606,13 +621,13 @@ echo "This will create an asound.conf file in the /etc/ directory with pulse aud
This script is meant to aid you in configuring but cannot account for all variations.
RIGCTL does not play nicely with CAT and RTS keying across all software. If you wish to use RIGCTL it is recommended to select SOCAT and check the RIGCTL box on the next screen." | yad --center --text-info --image=/tmp/banner.png --wrap --title=TriMode ${c} ${r} || exit 1
RIGCTL does not play nicely with CAT and RTS keying across all software. If you wish to use RIGCTL it is recommended to select SOCAT and check the RIGCTL box on the next screen." | yad --center --text-info --image=$DIR/images/corps-icon.png --wrap --title=TriMode ${c} ${r} || exit 1
}
function selection_dialogs() {
##This creates our menu with the initial selections and outputs the results to /tmp/trimode-selections
yad --center --wrap --title="TriMode Setup" --text="Please answer the following selections:" \
--image=/tmp/banner.png \
--image=$DIR/images/corps-icon.png \
--form --separator="," --item-separator="," --align=left \
--field="Select ardop file:SFL" $HOME/Radio/ARDOP \
--field="PTT Method::"CB "SOCAT-RIGCTLD,VOX,RTS,CAT" \
@@ -672,7 +687,7 @@ function easy_button() {
echo "Would you like to use the default Tri-Mode setup? This setup will use FLRIG to control your radio and allow for Tri/Quad Mode easily for most popular setups." | yad \
--center \
--text-info \
--image=/tmp/banner.png \
--image=$DIR/images/corps-icon.png \
--wrap \
--title="Easy Button" \
--button="Yes:0" \
@@ -685,7 +700,7 @@ ${c} ${r} ||
fi
yad --center --wrap --title="ARDOP Location" --text="Please answer the following selections:" \
--image=/tmp/banner.png \
--image=$DIR/images/corps-icon.png \
--form --separator="," --item-separator="," --align=left \
--field="Select ardop file:SFL" $HOME/Radio/ARDOP \
--field="Tip::TXT" "Please ensure you select your ardop file." \