Vara attempt

Removed autoremoval of source directories
This commit is contained in:
tb14
2022-11-05 12:41:10 -05:00
parent 3ef1eab0c2
commit 66ac1e6fb3
3 changed files with 112 additions and 270 deletions
+30 -30
View File
@@ -630,9 +630,9 @@ sudo ldconfig ||
{ ERRCODE="ldconfig failed"; errors; return; } { ERRCODE="ldconfig failed"; errors; return; }
#Cleanup space from compiling #Cleanup space from compiling
if hash rigctld 2>/dev/null; then #if hash rigctld 2>/dev/null; then
sudo rm -r $USERDIR/hamlib-${NEWHAMLIB} # sudo rm -r $USERDIR/hamlib-${NEWHAMLIB}
fi #fi
fi fi
@@ -685,9 +685,9 @@ install ||
fi fi
#Cleanup space from compiling #Cleanup space from compiling
if hash fldigi 2>/dev/null; then #if hash fldigi 2>/dev/null; then
sudo rm -r $USERDIR/fldigi-${NEWFLDIGI} # sudo rm -r $USERDIR/fldigi-${NEWFLDIGI}
fi #fi
fi fi
} }
@@ -721,9 +721,9 @@ install ||
fi fi
#Cleanup space from compiling #Cleanup space from compiling
if hash flmsg 2>/dev/null; then #if hash flmsg 2>/dev/null; then
sudo rm -r $USERDIR/flmsg-${NEWFLMSG} # sudo rm -r $USERDIR/flmsg-${NEWFLMSG}
fi #fi
fi fi
} }
@@ -757,9 +757,9 @@ install ||
fi fi
#Cleanup space from compiling #Cleanup space from compiling
if hash flamp 2>/dev/null; then #if hash flamp 2>/dev/null; then
sudo rm -r $USERDIR/flamp-${NEWFLAMP} # sudo rm -r $USERDIR/flamp-${NEWFLAMP}
fi #fi
fi fi
} }
@@ -793,9 +793,9 @@ install ||
fi fi
#Cleanup space from compiling #Cleanup space from compiling
if hash flrig 2>/dev/null; then #if hash flrig 2>/dev/null; then
sudo rm -r $USERDIR/flrig-${NEWFLRIG} # sudo rm -r $USERDIR/flrig-${NEWFLRIG}
fi #fi
fi fi
} }
@@ -833,9 +833,9 @@ install ||
fi fi
#Cleanup space from compiling #Cleanup space from compiling
if hash flwrap 2>/dev/null; then #if hash flwrap 2>/dev/null; then
sudo rm -r $USERDIR/flwrap-${NEWFLWRAP} # sudo rm -r $USERDIR/flwrap-${NEWFLWRAP}
fi #fi
fi fi
fi fi
} }
@@ -1170,9 +1170,9 @@ cd arim-${NEWARIM} ||
{ ERRCODE="Failed to compile ARIM"; errors; return; } { ERRCODE="Failed to compile ARIM"; errors; return; }
#Cleanup space from compiling #Cleanup space from compiling
if hash arim 2>/dev/null; then #if hash arim 2>/dev/null; then
sudo rm -r $USERDIR/arim-${NEWARIM} # sudo rm -r $USERDIR/arim-${NEWARIM}
fi #fi
fi fi
} }
@@ -1204,9 +1204,9 @@ cd garim-${NEWGARIM} ||
{ ERRCODE="Failed to compile GARIM"; errors; return; } { ERRCODE="Failed to compile GARIM"; errors; return; }
#Cleanup space from compiling #Cleanup space from compiling
if hash garim 2>/dev/null; then #if hash garim 2>/dev/null; then
sudo rm -r $USERDIR/garim-${NEWGARIM} # sudo rm -r $USERDIR/garim-${NEWGARIM}
fi #fi
fi fi
} }
@@ -1428,9 +1428,9 @@ WSJTXDIR=$(echo $WSJTXPKG | sed 's/.tgz//')
#Cleanup space from compiling #Cleanup space from compiling
if hash wsjtx 2>/dev/null; then #if hash wsjtx 2>/dev/null; then
sudo rm -r $USERDIR/$WSJTXDIR # sudo rm -r $USERDIR/$WSJTXDIR
fi #fi
fi fi
} }
@@ -1510,9 +1510,9 @@ if [[ ${JS8CALLVER} == ${NEWJS8CALLVER} ]]; then
#Cleanup space from compiling #Cleanup space from compiling
if hash js8call 2>/dev/null; then #if hash js8call 2>/dev/null; then
sudo rm -r $USERDIR/js8call # sudo rm -r $USERDIR/js8call
fi #fi
fi fi
} }
+81 -240
View File
@@ -3,271 +3,112 @@
################################################################################ ################################################################################
####################### AmRRON Vara Setup ######################### ####################### AmRRON Vara Setup #########################
####################### Created by TB-14 ######################### ####################### Created by TB-14 #########################
####################### 04 NOV 2022 ######################### ####################### 05 NOV 2022 #########################
################################################################################ ################################################################################
################################################################################ ################################################################################
### This script will perform basic setup for VARA. ### This script will perform basic setup for VARA.
### Tested on Mint 21 ### Tested on Mint 21
### Using guidance and tools from TK-05 and ptitSeb, Box86, and KI7POL ### Using guidance and tools from TK-05, KM4ACK, ptitSeb, Box86, and KI7POL
function set_screen_size() { VARAHFVER=$(curl -s https://rosmodem.wordpress.com/ | grep -m 1 "VARA HF" | awk -F "VARA HF" '{print $2}' | awk -F " " '{print $1}' | sed s/\ //g)
screen_size=$(xdpyinfo | grep dimensions | \ VARAFMVER=$(curl -s https://rosmodem.wordpress.com/ | grep -m 1 "VARA FM" | awk -F "VARA FM" '{print $2}' | awk -F " " '{print $1}' | sed s/\ //g)
sed -r 's/^[^0-9]*([0-9]+x[0-9]+).*$/\1/' | sed s/x/" "/ || echo 800 480) VARACHATVER=$(curl -s https://rosmodem.wordpress.com/ | grep -m 1 "VARA Chat" | awk -F "VARA Chat" '{print $2}' | awk -F " " '{print $1}' | sed s/\ //g)
width=$(echo $screen_size | awk '{print $1}')
height=$(echo $screen_size | awk '{print $2}')
#xdpyinfo | grep 'dimensions:'
# Divide by two so the dialogs take up half of the screen, which looks nice.
rows=$(( height / 2 ))
columns=$(( width / 2 ))
# Unless the screen is tiny
rows=$(( rows < 400 ? 400 : rows ))
columns=$(( columns < 700 ? 700 : columns ))
c="--width=${columns}"
r="--height=${rows}"
}
function determine_os() {
#Deterimine computer type.
function noOS_Support() {
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." \
${r} ${c}
exit 1
}
function maybeOS_Support() {
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 Raspberry Pi OS Buster and Bullseye \
(32bit and 64bit), Linux Mint 20.3 and 21. It should work on most Debian 10 / 11 based distros. \n\nWould you like to continue anyway?" ${r} ${c}) then
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=$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"
VARAFMLINK=$(curl -s https://rosmodem.wordpress.com/ | grep -oP '(?=https://mega.nz).*?(?=" target="_blank" rel="noopener noreferrer">VARA FM v)')
VARAHFLINK=$(curl -s https://rosmodem.wordpress.com/ | grep -oP '(?=https://mega.nz).*?(?=" target="_blank" rel="noopener noreferrer">VARA HF v)')
VARACHATLINK=$(curl -s https://rosmodem.wordpress.com/ | grep -oP '(?=https://mega.nz).*?(?=" target="_blank" rel="noopener noreferrer">VARA Chat v)')
# Compatibility check for OS
# if lsb_release command is on their system
if hash lsb_release 2>/dev/null; then
PLAT=$(lsb_release -si) function usergroups() {
OSCN=$(lsb_release -sc) # We want this to be trusty xenial bionic cosmic disco; jessie strech buster; sara serena sonya sylvia tara tessa tina clear;echo
echo "adding user to tty, dialout, & audio groups"
else # else get info from os-release sleep 1
MYUSER=$(whoami)
PLAT=$(grep "^NAME" /etc/os-release | awk -F "=" '{print $2}' | tr -d '"' \ CHK_DIALOUT=$(id -nG | grep dialout)
| awk '{print $1}') CHK_TTY=$(id -nG | grep tty)
VER=$(grep "VERSION_ID" /etc/os-release | awk -F "=" '{print $2}' | tr -d '"') CHK_AUDIO=$(id -nG | grep audio)
declare -A VER_MAP=(["11"]="bullseye" ["10"]="buster" ["9"]="stretch" ["8"]="jessie" ["16.04"]="xenial" \
["14.04"]="trusty" ["18.04"]="bionic" ["18.10"]="cosmic" ["19.04"]="disco" ["19.10"]="eoan" ["20.04"]="focal" ["18"]="sara" ["18.1"]="serena" \
["18.2"]="sonya" ["18.3"]="sylvia" ["19"]="tara" ["19.1"]="tessa" ["19.2"]="tina" ["19.3"]="tricia" ["20"]="ulyana" ["20.3"]="una" ["21"]="vanessa" )
OSCN=${VER_MAP["${VER}"]}
fi
case ${PLAT} in
Raspbian|Debian|Linuxmint)
case ${OSCN} in
buster|bullseye|una|vanessa)
;;
*)
maybeOS_Support
;;
esac
;;
*)
noOS_Support
;;
esac
}
#create a finish trap
function finish {
if [[ -f /tmp/vara-failures ]]; then
rm /tmp/vara-failures
fi
}
trap finish EXIT
### clean up from previous attemps
if [[ -f /tmp/vara_failures ]]; then
echo "/tmp/failures file previously exists. Moving to /tmp/failures.bak"
mv /tmp/vara_failures /tmp/vara_failures.bak
fi
# Create a error function to make life easier later on
function errors() {
echo "${ERRCODE}" >> /tmp/vara_failures
}
function install_vara_mint21() {
if hash wine 2>/dev/null; then
echo "Wine appears to already be installed. Click OK to continue to the next step" | yad \
--text-info --image=$DIR/images/corps-icon.png --center --wrap \
--button="No:0" --button="OK:2" \
--title "Wine Installation." \
${r} ${c}
rc=$?
if [[ $rc -eq 2 ]]; then
echo "Wine already installed"
elif [[ $rc == 0 ]]; then
yad --image=$DIR/images/corps-icon.png --center --button="gtk-ok:0" --title "Exit Selected" --text "Exiting installer now" ${r} ${c}
exit 1
fi
if [ -z "$CHK_DIALOUT" ]; then
echo "Adding user to dialout group"
sudo usermod -a -G dialout $MYUSER
else else
echo "User already in dialout group"
echo "Wine needs to be installed in order to run VARA on Linux. Would you like me to attempt to do this now?" | yad \
--text-info --image=$DIR/images/corps-icon.png --center --wrap \
--button="No:0" --button="Install Wine:2" \
--title "Wine Installation." \
${r} ${c}
rc=$?
if [[ $rc -eq 2 ]]; then
echo "Installing Wine" | sudo apt-get install -y wine ||
{ ERRCODE="Failed to install wine"; errors; }
elif [[ $rc == 0 ]]; then
yad --image=$DIR/images/corps-icon.png --center --button="gtk-ok:0" --title "Exit Selected" --text "Exiting installer now" ${r} ${c}
exit 1
fi
fi
echo "Now we will install the dependencies required" | yad \
--text-info --image=$DIR/images/corps-icon.png --center --wrap \
--button="No:0" --button="Install Dependencies:2" \
--title "Dependency Installation." \
${r} ${c}
rc=$?
if [[ $rc -eq 2 ]]; then
echo "Installing Dependencies" | sudo dpkg --add-architecture i386 && sudo apt update && sudo apt install -y libc6-i386 && sudo apt install -y libasound2-plugins:i386 && sudo apt upgrade -y ||
{ ERRCODE="Failed to install dependencies"; errors; }
elif [[ $rc == 0 ]]; then
yad --image=$DIR/images/corps-icon.png --center --button="gtk-ok:0" --title "Exit Selected" --text "Exiting installer now" ${r} ${c}
exit 1
fi fi
if [ -z "$CHK_TTY" ]; then
echo "Now we will download, modify, and run the WheezyE installer script." | yad \ echo "Adding user to tty group"
--text-info --image=$DIR/images/corps-icon.png --center --wrap \ sudo usermod -a -G tty $MYUSER
--button="No:0" --button="Install WheezyE script:2" \ else
--title "WheezyE Vara Installation." \ echo "User already in tty group"
${r} ${c}
rc=$?
if [[ $rc -eq 2 ]]; then
echo "Downloading script, modifing for Pulse Audio and running." | wget -P $DIR/Files -N https://raw.githubusercontent.com/WheezyE/Winelink/main/docs/experiments/x86-64_Linux_distros/Debian-Ubuntu_x64.sh && sed -i 's/alsa/pulse/g' $DIR/Files/Debian-Ubuntu_x64.sh ||
{ ERRCODE="Failed to pull WheezyE Debian script and modify for pulse audio"; errors; }
elif [[ $rc == 0 ]]; then
yad --image=$DIR/images/corps-icon.png --center --button="gtk-ok:0" --title "Exit Selected" --text "Exiting installer now" ${r} ${c}
exit 1
fi fi
bash $DIR/Files/Debian-Ubuntu_x64.sh vara_only if [ -z "$CHK_AUDIO" ]; then
echo "Adding user to audio group"
sudo usermod -a -G audio $MYUSER
else
echo "User already in audio group"
fi
}
function install_wine() {
export WINEARCH=win32
#install dependencies
sudo apt install -y wine-stable winetricks
#install with wintricks
winetricks winxp
winetricks sound=pulse
winetricks vb6run
winetricks -q vcrun2015
#Install Driver
cd $HOME/Downloads
wget http://files.k6eta.com/pdh.dll.zip
unzip pdh.dll.zip && rm pdh.dll.zip
mv pdh.dll $HOME/.wine/drive_c/windows/system32
} }
function installvara() {
function install_vara_pi64() { #download/install VARA HF/FM
sudo apt install -y megatools curl p7zip-full
if [[ OSCN = Linuxmint ]]; then mkdir -P $USERDIR/VARA && cd $USERDIR/VARA
echo "Wine needs to be installed in order to run VARA on Linux. Would you like me to attempt to do this now?" | yad \ megadl $VARAHFLINK
--text-info --image=$DIR/images/corps-icon.png --center --wrap \ megadl $VARAFMLINK
--button="No:0" --button="Install Wine:2" \ megadl $VARACHATLINK
--title "Wine Installation." \ echo "unzipping VARA files"
${r} ${c} sleep 1
rc=$? unzip VARA\ FM\ $VARAFMVER\ Setup.zip
if [[ $rc -eq 2 ]]; then unzip VARA\ HF\ $VARAHFVER\ Setup.zip
echo "Installing Wine" | sudo apt-get install -y wine || unzip VARA\ Chat\ $VARACHATVER\ Setup.zip
{ ERRCODE="Failed to install wine"; errors; } rm VARA\ FM\ $VARAFMVER\ Setup.zip VARA\ HF\ $VARAHFVER\ Setup.zip VARA\ Chat\ $VARACHATVER\ Setup.zip
elif [[ $rc == 0 ]]; then #install VARA FM with wine
yad --image=$DIR/images/corps-icon.png --center --button="gtk-ok:0" --title "Exit Selected" --text "Exiting installer now" ${r} ${c} /usr/bin/wine VARA\ FM\ setup\ \(Run\ as\ Administrator\).exe
exit 1 #install VARA with wine
fi /usr/bin/wine VARA\ setup\ \(Run\ as\ Administrator\).exe
fi
} }
function installrmsexpress() {
function failure_handling() { mkdir -P $USERDIR/Winlink && cd $USERDIR/Winlink
wget -q -r -l1 -np -nd -A "Winlink_Express_install_*.zip" https://downloads.winlink.org/User%20Programs
FAIL=$(cat /tmp/failures) || echo "No failures recorded" unzip Winlink_Express_install*.zip
/usr/bin/wine Winlink_Express_install.exe
if [[ -f /tmp/failures ]]; then
yad --image=$DIR/images/corps-icon.png --center --button="Save Log:2" --button="gtk-ok:0" \
--title "Failures" \
--text "The following failures occured during installation:\n\n$FAIL" ${r} ${c} exit=$?
if [[ $? == 2 ]]; then
ERRORLOG=$HOME/AmRRON-Vara-Setup-failures
if [[ -e $ERRORLOG.log ]]; then
i=1
while [[ -e $ERRORLOG-$i.log ]] ; do
let i++
done
ERRORLOG=$ERRORLOG-$i
fi
cp /tmp/failures $ERRORLOG.log
yad --center --button="gtk-ok:0" \
--image=$DIR/images/corps-icon.png \
--title "Failure Log Saved" \
--text "A copy of the failure log was saved at $ERRORLOG.log" ${r} ${c}
fi
fi
}
function install_vara () {
if [[ $OSCN = vanessa ]]; then
install_vara_mint21
elif [[ $OSCN = una ]]; then
install_vara_mint20.3
elif [[ $OSCN = bullseye ]] && [[ $(uname -m) = aarch64 ]]; then
install_vara_pi64
elif [[ $OSCN = bullseye ]] && [[ $(uname -m) = armv7l ]]; then
install_vara_pi_bullseye
elif [[ $OSCN = buster ]]; then
install_vara_pi_buster
fi
} }
echo $VARAHFVER $VARAFMVER $VARACHATVER
## Run the script megadl $VARAHFLINK
megadl $VARAFMLINK
set_screen_size megadl $VARACHATLINK
determine_os wget -q -r -l1 -np -nd -A "Winlink_Express_install_*.zip" https://downloads.winlink.org/User%20Programs
install_vara #usergroups
failure_handling #install_wine
#installvara
#installrmsexpress
+1
View File
@@ -1,5 +1,6 @@
# Version 0.7.4.3 # Version 0.7.4.3
- Testing g++ dependency for hamlib - Testing g++ dependency for hamlib
- Removed auto removal of source directories.
# Version 0.7.4.2 # Version 0.7.4.2
- Pulling ardopc from gitlab folder due to website release version issues. - Pulling ardopc from gitlab folder due to website release version issues.