cleaning up testing for merge to master

This commit is contained in:
tb14
2019-08-20 12:41:34 -07:00
parent 61659f2289
commit 7eb47174b4
5 changed files with 80 additions and 1231 deletions
+79 -16
View File
@@ -1,15 +1,16 @@
#!/bin/bash
################################################################################
################################################################################
####################### AmRRON Tri-Mode Setup v0.5.3 #########################
####################### AmRRON Tri-Mode Setup v0.6 #########################
####################### Created by TB-14 #########################
####################### 27 Mar 2019 #########################
####################### 18 Aug 2019 #########################
################################################################################
################################################################################
### This script will perform basic setup for TriMode Operation.
function set_screen_size() {
screen_size=$(xdpyinfo | grep dimensions | \
sed -r 's/^[^0-9]*([0-9]+x[0-9]+).*$/\1/' | sed s/x/" "/ || echo 800 480)
@@ -62,17 +63,16 @@ tested.\n\nThis installer has been tested on Raspbian Stretch, Ubuntu \
if hash lsb_release 2>/dev/null; then
PLAT=$(lsb_release -si)
OSCN=$(lsb_release -sc) # We want this to be trusty xenial bionic; jessie
#strech; sara serena sonya sylvia tara tessa
OSCN=$(lsb_release -sc) # We want this to be trusty xenial bionic cosmic disco; jessie strech buster; sara serena sonya sylvia tara tessa tina
else # else get info from os-release
PLAT=$(grep "^NAME" /etc/os-release | awk -F "=" '{print $2}' | tr -d '"' \
| awk '{print $1}')
VER=$(grep "VERSION_ID" /etc/os-release | awk -F "=" '{print $2}' | tr -d '"')
declare -A VER_MAP=(["9"]="stretch" ["8"]="jessie" ["16.04"]="xenial" \
["14.04"]="trusty" ["18.04"]="bionic" ["18"]="sara" ["18.1"]="serena" \
["18.2"]="sonya" ["18.3"]="sylvia" ["19"]="tara" ["19.1"]="tessa" )
declare -A VER_MAP=(["10"]="buster" ["9"]="stretch" ["8"]="jessie" ["16.04"]="xenial" \
["14.04"]="trusty" ["18.04"]="bionic" ["18.10"]="cosmic" ["19.04"]="disco" ["18"]="sara" ["18.1"]="serena" \
["18.2"]="sonya" ["18.3"]="sylvia" ["19"]="tara" ["19.1"]="tessa" ["19.2"]="tina" )
OSCN=${VER_MAP["${VER}"]}
fi
@@ -80,7 +80,7 @@ tested.\n\nThis installer has been tested on Raspbian Stretch, Ubuntu \
case ${PLAT} in
Ubuntu|Raspbian|Debian|LinuxMint)
case ${OSCN} in
trusty|xenial|bionic|jessie|stretch|sara|serena|sonya|sylvia|tara|tessa)
trusty|xenial|bionic|cosmic|disco|jessie|stretch|buster|sara|serena|sonya|sylvia|tara|tessa|tina)
;;
*)
maybeOS_Support
@@ -148,8 +148,8 @@ local var6='$patstat'
local var7='$patpid'
local var15='$guistat'
local var16='$guipid'
local var8='$(cat /tmp/process-status | sed -n '"'"2p"'"' | awk -F "|" '"'"'{print $1}'"'"')'
local var9='$(cat /tmp/process-status | sed -n '"'"3p"'"' | awk -F "|" '"'"'{print $1}'"'"')'
local var8='$(cat /tmp/process-status | sed -n '"'"3p"'"' | awk -F "|" '"'"'{print $1}'"'"')'
local var9='$(cat /tmp/process-status | sed -n '"'"5p"'"' | awk -F "|" '"'"'{print $1}'"'"')'
local var17='$(cat /tmp/process-status | sed -n '"'"4p"'"' | awk -F "|" '"'"'{print $1}'"'"')'
local var10='${ARDOPRESULTS}'
local var11='${PATRESULTS}'
@@ -158,12 +158,12 @@ local var12=$USERDIR
local var19='$(pidof pavucontrol)'
local var20='$pavustat'
local var21='$pavupid'
local var22='$(cat /tmp/process-status | sed -n '"'"5p"'"' | awk -F "|" '"'"'{print $1}'"'"')'
local var22='$(cat /tmp/process-status | sed -n '"'"1p"'"' | awk -F "|" '"'"'{print $1}'"'"')'
local var23='${PAVURESULTS}'
local var24='$(pidof rigctld)'
local var25='$rigstat'
local var26='$rigpid'
local var27='$(cat /tmp/process-status | sed -n '"'"1p"'"' | awk -F "|" '"'"'{print $1}'"'"')'
local var27='$(cat /tmp/process-status | sed -n '"'"2p"'"' | awk -F "|" '"'"'{print $1}'"'"')'
local var28='${RIGRESULTS}'
local var29='$(pidof socat)'
@@ -249,12 +249,12 @@ yad --center --checklist --list --print-all \
--title=Status \
--button=Close:1 --button=Toggle:0 \
--column=Active --column=Name --column=PID \
$var20 PAVUCONTROL $var21 \
$var25 RIGCTLD $var26 \
$var4 ARDOPC $var5 \
$var6 PAT $var7 \
$var15 ARDOP_GUI $var16 \
$var20 PAVUCONTROL $var21 \
--width=250 --height=200 >> /tmp/process-status || exit 0
$var6 PAT $var7 \
--width=250 --height=250 >> /tmp/process-status || exit 0
@@ -459,7 +459,9 @@ fi
else
#If they didnt choose to return to stock we set the variable to include their radio selections.
if [ -z "$ARDOPCMD" ]; then
ARDOPCMD="$ARDOPLOC$ONOFF$DEV &"
fi
if [[ $RIGCTLSEL == No ]];then
RIGCTLCMD='echo "You did not select to setup rigctld" | yad --center --text-info --wrap --title="Not Configured" --height=100 --width=300'
fi
@@ -578,6 +580,26 @@ awk 'NR==92 || NR==119 || NR==120' $ARDOPSTATUS | yad --center --text-info --ima
}
function final_instructions() {
echo "Tri-Mode has been configured.
Procedure:
1. Launch FLRIG, configure transceiver for your setup
2. Launch Ardop-status app.
3. Enable RIGTLD and PAVUCONTROL, select Toggle, they should now have PID's listed.
4. Now 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 \
--text-info --center --button="gtk-ok:0" \
--wrap \
--title "Complete" ${r} ${c}
}
function info_dialogs() {
echo "This will create an asound.conf file in the /etc/ directory with pulse audio settings and modify the ardop-status launcher in /usr/local/bin for your selected configuration.
@@ -645,10 +667,51 @@ ardop_launcher
}
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 \
--wrap \
--title="Easy Button" \
--button="Yes:0" \
--button="Custom Setup:1" \
${c} ${r} ||
{ selection_dialogs; }
if ! hash socat 2>/dev/null; then
sudo apt install -y socat
fi
yad --center --wrap --title="ARDOP Location" --text="Please answer the following selections:" \
--image=/tmp/banner.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." \
${c} ${r} > /tmp/trimode-selections || exit 1
#Here we read the selections and pull out the relevant info from them.
ARDOPLOC=$(cat /tmp/trimode-selections | awk -F "," '{print $1}')
#This catches if the user failed to select the ardopc location and sends them back to try again
if [[ ! -f $ARDOPLOC ]]; then
echo "You must select your ardop file before continuing." | yad --center --text-info --wrap --title=TriMode --button="Start Over:1" ${c} ${r} ||
{ selection_dialogs; return; }
fi
RIGCTLCMD="socat pty,link=/tmp/rigctl,waitslave,b38400 tcp:localhost:4532,retry &
rigctld -vvvvv -m 4 &"
ARDOPCMD="$ARDOPLOC 8515 pulse pulse --cat /tmp/rigctl:38400 --keystring 5420310A --unkeystring 5420300A &"
status_update
ardop_launcher
}
set_screen_size
determine_os
info_dialogs
selection_dialogs
easy_button
create_asound
show_results
final_instructions