-
Notifications
You must be signed in to change notification settings - Fork 0
/
install
executable file
·82 lines (69 loc) · 3.12 KB
/
install
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
#!/bin/bash
clear
##########################################################
## Comment out next 7 lines to enable the installer ##
## If you do, be prepared to file bug reports in github ##
## by logging in, going to the repository, clicking on ##
## Issues and then New Issue. Thanks for your help! ##
##########################################################
echo "*************************************************************"
echo "** DO NOT USE ME YET. I HAVEN'T BEEN TESTED VERY WELL! **"
echo "** You should also read through me before using me anyhow. **"
echo "*************************************************************"
echo "** If you enable it, please file bug reports on github!! ***"
echo "*************************************************************"
exit
######################################
## End en-/dis-abling the installer ##
######################################
echo -e "Making the disk read/write...\n"
rpi-rw
echo -e "Installing python3 goodies needed...\n"
sudo apt install python3-websockets python3-pip
sudo pip3 install ansi2html
sudo apt install python3-gpizero
sudo apt install python3-psutil
sudo apt install python3-serial
echo -e "Adding the mmdvm user to the system...\n"
sudo adduser --system --no-createhome --group mmdvm
echo -e "Adding the mmdvm user to the dialout group...\n"
sudo usermod -a -G dialout mmdvm
echo -e "Adding mmdvm to the sudoers file...\n"
sudo cat "mmdvm ALL=(ALL) NOPASSWD: /usr/local/bin/MMDVMHost
echo -e "Creating the /opt/MMDVMDash directory...\n"
sudo mkdir /opt/MMDVMDash
sudo chown -R mmdvm:mmdvm /opt/MMDVMDash
echo -e "Moving the systemd files to /lib/systemd/system...\n"
sudo mv systemd/*.service /lib/systemd/system
sudo systemctl daemon-reload
sudo systemctl enable http.server logtailer
echo -e "Adding the firewall rules needed to use MMDVMDash and activating them...\n"
sudo mv ipv?.fw /root
sudo /usr/local/sbin/pistar-firewall
echo -e "Adding a blank DMRIds.dat file...\n"
touch DMRIds.dat
echo -e "Moving files to /opt/MMDVMDash...\n"
sudo -u mmdvm * /opt/MMDVMDash
echo -e "Updating DMRIds.dat...\n"
sudo -u mmdvm /opt/MMDVMDash/scripts/DMRIDUpdate.sh
echo -e "Editing /etc/mmdvmhost to increase logging to the required number...\n"
sudo sed -i 's/FileLevel\=0/FileLevel\=2/g' /etc/mmdvmhost
sudo sed -i 's/FileLevel\=1/FileLevel\=2/g' /etc/mmdvmhost
sudo sed -i 's/FileLevel\=3/FileLevel\=2/g' /etc/mmdvmhost
read -p "The default config for config.js will work fine. Do you want to edit it (Y/N): " anykey
case in anykey
Y | y)
sudo -u mmdvm nano /opt/MMDVMDash/html/js/config.js
;;
N | n)
echo -e "Go to your pi-star dashboard and make sure that DEBUG is set to 0 for all services...\n"
read -p "Press any key to continue: " somethingelse
echo -e "Restarting MMDVMHost...\n"
sudo systemctl restart mmdvmhost
echo -e "Firing up MMDVMDash...\n"
sudo systemctl start http.server logtailer
echo -e "DONE! Now open your browser and enter the URL for your pi-star. Be sure add \":8000\" to the address to load MMDVMDash!"
echo -e "If it's not working, you're on your own to figure out why. Sorry.\n\n"
;;
esac
echo -e "Bye!\n\n"