mirror of
https://gitlab.com/amrron/setup-scripts.git
synced 2026-10-17 01:54:00 -04:00
Setup script add VARIM
tweak Vara Setup
This commit is contained in:
+157
-64
@@ -1,7 +1,7 @@
|
||||
#!/bin/bash
|
||||
################################################################################
|
||||
################################################################################
|
||||
####################### AmRRON Vara Setup #########################
|
||||
####################### AmRRON Vara Setup v.0.1 #########################
|
||||
####################### Created by TB-14 #########################
|
||||
####################### 05 NOV 2022 #########################
|
||||
################################################################################
|
||||
@@ -59,7 +59,7 @@ SOURCE="${BASH_SOURCE[0]}"
|
||||
|
||||
# Create a error function to make life easier later on
|
||||
function errors() {
|
||||
echo "${ERRCODE}" >> /tmp/failures
|
||||
echo "${ERRCODE}" >> /tmp/varafailures
|
||||
}
|
||||
|
||||
#Deterimine computer type.
|
||||
@@ -129,20 +129,9 @@ tested.\n\nThis installer has been tested on Raspberry Pi OS Buster and Bullseye
|
||||
|
||||
#create a finish trap
|
||||
function finish {
|
||||
if [[ -f /tmp/results ]]; then
|
||||
rm /tmp/results
|
||||
fi
|
||||
|
||||
if [[ -f /tmp/mastermenu ]]; then
|
||||
rm /tmp/mastermenu
|
||||
fi
|
||||
|
||||
if [[ -f /tmp/cleanup ]]; then
|
||||
rm /tmp/cleanup
|
||||
fi
|
||||
|
||||
if [[ -f /tmp/failures ]]; then
|
||||
rm /tmp/failures
|
||||
rm /tmp/varafailures
|
||||
fi
|
||||
|
||||
}
|
||||
@@ -151,21 +140,6 @@ trap finish EXIT
|
||||
|
||||
##make sure we dont already have a cleanup, mastermenu, or results text file
|
||||
|
||||
if [[ -f /tmp/results ]]; then
|
||||
echo "Results file previously exists. Moving to /tmp/results.bak"
|
||||
mv /tmp/results /tmp/results.bak
|
||||
fi
|
||||
|
||||
if [[ -f /tmp/mastermenu ]]; then
|
||||
echo "/tmp/mastermenu file previously exists. Moving to /tmp/mastermenu.bak"
|
||||
mv /tmp/mastermenu /tmp/mastermenu.bak
|
||||
fi
|
||||
|
||||
if [[ -f /tmp/cleanup ]]; then
|
||||
echo "/tmp/cleanup file previously exists. Moving to /tmp/cleanup.bak"
|
||||
mv /tmp/cleanup /tmp/cleanup.bak
|
||||
fi
|
||||
|
||||
if [[ -f /tmp/failures ]]; then
|
||||
echo "/tmp/failures file previously exists. Moving to /tmp/failures.bak"
|
||||
mv /tmp/failures /tmp/failures.bak
|
||||
@@ -191,9 +165,40 @@ VARAFMLINK=$(curl -s https://rosmodem.wordpress.com/ | grep -oP '(?=https://mega
|
||||
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)')
|
||||
|
||||
function primer_menu() {
|
||||
|
||||
echo "This program is designed to assist you with installing VARA HF, VARA FM \
|
||||
VARA Chat, and Winlink RMS Express on your linux machine. The current version has \
|
||||
only been tested on Mint 21. I will continue to expand support for Mint 20 and Rasberry Pi OS \
|
||||
in the future.
|
||||
|
||||
Super User (sudo) priveledges are required to perform the apt-get \
|
||||
commands.
|
||||
|
||||
You will be asked for your password in the terminal to perform some \
|
||||
tasks but you should not run the entire program as Root. \
|
||||
|
||||
You will need to accept agreements and interact with the installers.
|
||||
Wine is set to default to pulseaudio. You can modify the winetricks sound=pulse \
|
||||
line of this script to alsa if you desire to use alsa instead.
|
||||
|
||||
This will: \
|
||||
check and add user to the dialout, audio, and tty usergroups; \
|
||||
Install wine and winetricks; download and install VARA HF, FM, and Chat; \
|
||||
download and install Winlink Express." | yad \
|
||||
--image=$DIR/images/corps-icon.png \
|
||||
--text-info \
|
||||
--wrap \
|
||||
--center \
|
||||
--title "Welcome to the AmRRON Vara Installer." \
|
||||
${r} ${c} ||
|
||||
{ yad --image=$DIR/images/corps-icon.png --center --button="gtk-ok:0" --title "Exit Selected" --text "Exiting installer now" ${r} ${c}; exit 1; }
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
function usergroups() {
|
||||
clear;echo
|
||||
echo "adding user to tty, dialout, & audio groups"
|
||||
sleep 1
|
||||
MYUSER=$(whoami)
|
||||
@@ -203,21 +208,24 @@ CHK_AUDIO=$(id -nG | grep audio)
|
||||
|
||||
if [ -z "$CHK_DIALOUT" ]; then
|
||||
echo "Adding user to dialout group"
|
||||
sudo usermod -a -G dialout $MYUSER
|
||||
sudo usermod -a -G dialout $MYUSER ||
|
||||
{ ERRCODE="Failed to add user to dialout group"; errors; }
|
||||
else
|
||||
echo "User already in dialout group"
|
||||
fi
|
||||
|
||||
if [ -z "$CHK_TTY" ]; then
|
||||
echo "Adding user to tty group"
|
||||
sudo usermod -a -G tty $MYUSER
|
||||
sudo usermod -a -G tty $MYUSER ||
|
||||
{ ERRCODE="Failed to add user to tty group"; errors; }
|
||||
else
|
||||
echo "User already in tty group"
|
||||
fi
|
||||
|
||||
if [ -z "$CHK_AUDIO" ]; then
|
||||
echo "Adding user to audio group"
|
||||
sudo usermod -a -G audio $MYUSER
|
||||
sudo usermod -a -G audio $MYUSER ||
|
||||
{ ERRCODE="Failed to add user to audio group"; errors; }
|
||||
else
|
||||
echo "User already in audio group"
|
||||
fi
|
||||
@@ -227,54 +235,139 @@ function install_wine() {
|
||||
export WINEARCH=win32
|
||||
|
||||
#install dependencies
|
||||
sudo apt install -y wine-stable winetricks
|
||||
sudo apt install -y wine-stable winetricks ||
|
||||
{ ERRCODE="Failed to install wine-stable and winetricks"; errors; }
|
||||
|
||||
#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
|
||||
winetricks winxp ||
|
||||
{ ERRCODE="Failed to set winetricks winxp"; errors; }
|
||||
winetricks sound=pulse ||
|
||||
{ ERRCODE="Failed to set winetricks sound=pulse"; errors; }
|
||||
winetricks vb6run ||
|
||||
{ ERRCODE="Failed to set winetricks vb6run"; errors; }
|
||||
winetricks -q vcrun2015 ||
|
||||
{ ERRCODE="Failed to set winetricks -q vcrun2015"; errors; }
|
||||
|
||||
}
|
||||
|
||||
function installvara() {
|
||||
#download/install VARA HF/FM
|
||||
sudo apt install -y megatools curl p7zip-full
|
||||
mkdir -P $USERDIR/VARA && cd $USERDIR/VARA
|
||||
megadl $VARAHFLINK
|
||||
megadl $VARAFMLINK
|
||||
megadl $VARACHATLINK
|
||||
echo "unzipping VARA files"
|
||||
sleep 1
|
||||
unzip VARA\ FM\ $VARAFMVER\ Setup.zip
|
||||
unzip VARA\ HF\ $VARAHFVER\ Setup.zip
|
||||
unzip VARA\ Chat\ $VARACHATVER\ Setup.zip
|
||||
rm VARA\ FM\ $VARAFMVER\ Setup.zip VARA\ HF\ $VARAHFVER\ Setup.zip VARA\ Chat\ $VARACHATVER\ Setup.zip
|
||||
#install VARA FM with wine
|
||||
/usr/bin/wine VARA\ FM\ setup\ \(Run\ as\ Administrator\).exe
|
||||
#install VARA with wine
|
||||
/usr/bin/wine VARA\ setup\ \(Run\ as\ Administrator\).exe
|
||||
sudo apt install -y megatools curl p7zip-full ||
|
||||
{ ERRCODE="Failed to install dependencies for pulling vara installation files"; errors; }
|
||||
cd $HOME/Downloads
|
||||
megadl $VARAHFLINK ||
|
||||
{ ERRCODE="Failed to download VARA HF"; errors; }
|
||||
megadl $VARAFMLINK ||
|
||||
{ ERRCODE="Failed to download VARA FM"; errors; }
|
||||
megadl $VARACHATLINK ||
|
||||
{ ERRCODE="Failed to download VARA Chat"; errors; }
|
||||
|
||||
|
||||
unzip VARA\ FM\ $VARAFMVER\ Setup.zip ||
|
||||
{ ERRCODE="Failed to unzip VARA FM"; errors; }
|
||||
unzip VARA\ HF\ $VARAHFVER\ Setup.zip ||
|
||||
{ ERRCODE="Failed to unzip VARA HF"; errors; }
|
||||
unzip VARA\ Chat\ $VARACHATVER\ Setup.zip ||
|
||||
{ ERRCODE="Failed to unzip VARA Chat"; errors; }
|
||||
|
||||
rm VARA\ FM\ $VARAFMVER\ Setup.zip VARA\ HF\ $VARAHFVER\ Setup.zip VARA\ Chat\ $VARACHATVER\ Setup.zip ||
|
||||
{ ERRCODE="Failed to remove VARA zip files"; errors; }
|
||||
#install VARA FM with wine
|
||||
/usr/bin/wine VARA\ FM\ setup\ \(Run\ as\ Administrator\).exe ||
|
||||
{ ERRCODE="Failed to install VARA FM"; errors; }
|
||||
#install VARA with wine
|
||||
/usr/bin/wine VARA\ setup\ \(Run\ as\ Administrator\).exe ||
|
||||
{ ERRCODE="Failed to install VARA HF"; errors; }
|
||||
#install VARA Chat with wine
|
||||
/usr/bin/wine VARA\ Chat\ \(Run\ as\ Administrator\).exe ||
|
||||
{ ERRCODE="Failed to install VARA Chat"; errors; }
|
||||
|
||||
#Install Driver
|
||||
cd $HOME/Downloads && wget http://files.k6eta.com/pdh.dll.zip ||
|
||||
{ ERRCODE="Failed to download k6eta pdh.dll drivers"; errors; }
|
||||
unzip pdh.dll.zip && rm pdh.dll.zip ||
|
||||
{ ERRCODE="Failed to unzip k6eta drivers"; errors; }
|
||||
mv pdh.dll $HOME/.wine/drive_c/windows/system32
|
||||
{ ERRCODE="Failed to move drivers to $HOME/.wine/drive_c/windows/system32"; errors; }
|
||||
|
||||
}
|
||||
|
||||
function installrmsexpress() {
|
||||
mkdir -P $USERDIR/Winlink && cd $USERDIR/Winlink
|
||||
wget -q -r -l1 -np -nd -A "Winlink_Express_install_*.zip" https://downloads.winlink.org/User%20Programs
|
||||
unzip Winlink_Express_install*.zip
|
||||
/usr/bin/wine Winlink_Express_install.exe
|
||||
cd $HOME/Downloads
|
||||
wget -q -r -l1 -np -nd -A "Winlink_Express_install_*.zip" https://downloads.winlink.org/User%20Programs ||
|
||||
{ ERRCODE="Failed to download Winlink Express"; errors; }
|
||||
unzip Winlink_Express_install*.zip && rm Winlink_Express_install*.zip ||
|
||||
{ ERRCODE="Failed to unzip Winlink Express"; errors; }
|
||||
/usr/bin/wine Winlink_Express_install.exe ||
|
||||
{ ERRCODE="Failed to Install Winlink Express"; errors; }
|
||||
|
||||
}
|
||||
|
||||
function failure_handling() {
|
||||
|
||||
FAIL=$(cat /tmp/varafailures) || echo "No failures recorded"
|
||||
|
||||
|
||||
if [[ -f /tmp/varafailures ]]; 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/varafailures $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 complete() {
|
||||
echo "All selected updates have been completed." | yad --image=$DIR/images/donate.png \
|
||||
--text-info --center --wrap --button="gtk-ok:0" \
|
||||
--title "Complete" ${r} ${c}
|
||||
|
||||
echo "You will need to set your sound card usage in each program on first use.
|
||||
|
||||
It is recommended to restart your system before continuing.
|
||||
|
||||
Would you like to restart now?" | yad --center \
|
||||
--text-info --wrap \
|
||||
--image=$DIR/images/corps-icon.png \
|
||||
--title "Restart" --button="No:1" --button="Restart:2" ${r} ${c}
|
||||
rc=$?
|
||||
if [[ $rc -eq 2 ]]; then
|
||||
sudo shutdown -r now
|
||||
elif [[ $rc -eq 1 ]]; then
|
||||
echo "Good luck and 73's" | yad --image=$DIR/images/corps-icon.png \
|
||||
--text-info --wrap \
|
||||
--center --button="gtk-ok:0" \
|
||||
--title "Thank you." ${r} ${c}
|
||||
exit 1
|
||||
else
|
||||
echo "You closed the window without making a selection. Installer exiting."
|
||||
|
||||
exit 1
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
set_screen_size
|
||||
confirm_mint21
|
||||
primer_menu
|
||||
usergroups
|
||||
install_wine
|
||||
installvara
|
||||
installrmsexpress
|
||||
installrmsexpress
|
||||
failure_handling
|
||||
complete
|
||||
Reference in New Issue
Block a user