-
Notifications
You must be signed in to change notification settings - Fork 1
/
svxlink_install_wizard.sh
129 lines (114 loc) · 4.5 KB
/
svxlink_install_wizard.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
#!/usr/bin/env bash
## Author: Danilo - S58DB
## E-mail: s58db.danilo@gmail.com
## Util Methods:
function displayMessage() {
whiptail --title "$1" --msgbox "$2" 8 78
}
function main() {
while true; do
menusvxlink=$(whiptail --title "...::::: SVXlink Installing Wizard :::::..." --ok-button "Select" --cancel-button "Quit" --menu "Izberi namestitev" 20 78 10 \
"1" "..:: Install SVXLink on RPi ::.." \
"2" "..:: Install SVXLink on PC ::.." \
"3" "..:: Copy importatnt folders SVXLink ::.." \
"4" "..:: Remove SVXLink folder from system ::.." \
3>&1 1>&2 2>&3)
exitstatus=$?
if [ ${exitstatus} = 0 ]; then
case ${menusvxlink} in
1)
svxlinkInstallRpi
;;
2)
svxlinkInstallPC
;;
3)
svxlinkcopyall
;;
4)
svxlinkUninstall
;;
esac
else
exit
fi
done
}
function svxlinkInstallRpi() {
cd ~
sudo apt update && sudo apt full-upgrade -y
sudo apt-get install build-essential wget g++ cmake make libsigc++-2.0-dev libgsm1-dev libpopt-dev tcl-dev libgcrypt20-dev libspeex-dev libasound2-dev libopus-dev librtlsdr-dev doxygen groff alsa-utils vorbis-tools curl libcurl4-openssl-dev git rtl-sdr libjsoncpp-dev speedtest-cli mutt mc libgpiod-dev gpiod libssl-dev libgpiod-dev gpiod -y
sudo useradd -U -r -G audio,plugdev,daemon,gpio svxlink
cd ~
git clone https://github.com/sm0svx/svxlink.git
mkdir ~/svxlink/src/build
cd ~/svxlink/src/build
cmake -DUSE_QT=OFF -DCMAKE_INSTALL_PREFIX=/usr -DSYSCONF_INSTALL_DIR=/etc -DLOCAL_STATE_DIR=/var -DWITH_SYSTEMD=ON ..
make
make doc
sudo make install
sudo ldconfig
cd /usr/share/svxlink/sounds/
sudo wget https://github.com/sm0svx/svxlink-sounds-en_US-heather/releases/download/19.09.99.2/svxlink-sounds-en_US-heather-16k-19.09.99.2.tar.bz2
sudo tar xvjf svxlink-sounds-en_US-heather-16k-19.09.99.2.tar.bz2
sudo mv en_US-heather-16k en_US
cd ~
whiptail --msgbox "Install is complite..." 10 50
}
function svxlinkInstallPC() {
cd ~
sudo apt-get update && sudo upgrade -y
sudo apt-get install build-essential wget g++ cmake make libsigc++-2.0-dev libgsm1-dev libpopt-dev tcl-dev libgcrypt20-dev libspeex-dev libasound2-dev libopus-dev librtlsdr-dev doxygen groff alsa-utils vorbis-tools curl libcurl4-openssl-dev git rtl-sdr libjsoncpp-dev speedtest-cli mutt mc alsa-utils -y
sudo useradd -U -r -G audio,plugdev,daemon svxlink
cd ~
git clone https://github.com/sm0svx/svxlink.git
mkdir ~/svxlink/src/build
cd ~/svxlink/src/build
cmake -DUSE_QT=OFF -DCMAKE_INSTALL_PREFIX=/usr -DSYSCONF_INSTALL_DIR=/etc -DLOCAL_STATE_DIR=/var -DWITH_SYSTEMD=ON ..
make
make doc
sudo make install
sudo ldconfig
cd /usr/share/svxlink/sounds/
sudo wget https://github.com/sm0svx/svxlink-sounds-en_US-heather/releases/download/24.02/svxlink-sounds-en_US-heather-16k-24.02.tar.bz2
sudo tar xvjf svxlink-sounds-en_US-heather-16k-24.02.tar.bz2
sudo mv en_US-heather-16k en_US
sudo rm svxlink-sounds-en_US-heather-16k-24.02.tar.bz2
whiptail --msgbox "Install is complite..." 10 50
}
function svxlinkUninstall() {
sudo rm -rf ~/svxlink/
echo ~/svxlink/
sleep 1
sudo rm -rf /etc/svxlink/
echo /etc/svxlink/
sleep 1
sudo rm -rf /var/spool/svxlink/
echo /var/spool/svxlink/
sleep 1
sudo rm -rf /usr/share/svxlink/
echo /usr/share/svxlink/
sleep 1
whiptail --msgbox "Delite all files is complite..." 10 50
}
function svxlinkcopyall() {
cd ~
mkdir "Kopija_SVXLink_$(date +"%d_%m_%Y")"
cd Kopija_SVXLink_$(date +"%d_%m_%Y")
mkdir etc
mkdir etc/svxlink
mkdir usr
mkdir usr/share
mkdir usr/share/svxlink
mkdir var
mkdir var/spool
mkdir var/spool/svxlink
cp -f -r /etc/svxlink/* etc/svxlink/
cp -f -r /usr/share/svxlink/* usr/share/svxlink/
cp -f -r /var/spool/svxlink/* var/spool/svxlink/
cd ~
echo Your backup is here /home/$USER/Kopija_SVXLink_$(date +"%d_%m_%Y")
chown -hR pi:pi Kopija_SVXLink_$(date +"%d_%m_%Y")
whiptail --msgbox "Copy all file is complite..." 10 50
}
main