-
Notifications
You must be signed in to change notification settings - Fork 3
/
setup
117 lines (92 loc) · 4.44 KB
/
setup
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
#!/bin/bash
clear
echo
echo
echo "---------------- Please Wait ---------------------"
if [ ! -d /var/lib/dvswitch/dvs ] || [ ! -d /usr/local/dvs ]; then
echo
echo
echo "-------- DVSwitch not installed ----------"
echo
echo
exit 0
fi
sudo wget -O /var/lib/dvswitch/dvs/var00.txt https://raw.githubusercontent.com/hp3icc/DVSMU/main/var00.txt > /dev/null 2>&1
files="analog_bridge00.service mmdvm_bridge00.service md380-emu00.service"
for file in $files; do
sudo wget -O /var/lib/dvswitch/dvs/$file https://raw.githubusercontent.com/hp3icc/DVSMU/main/$file > /dev/null 2>&1
sudo chmod +x /var/lib/dvswitch/dvs/$file
echo "----------------------------------------------------"
done
sudo wget -O /usr/local/dvs/dvsmu https://raw.githubusercontent.com/hp3icc/DVSMU/main/dvsmu > /dev/null 2>&1
sudo chmod +x /usr/local/dvs/dvsmu
echo "----------------------------------------------------"
file=DMRIds_chk.sh
sudo wget -O /usr/local/dvs/$file https://raw.githubusercontent.com/hp3icc/DVSMU/main/$file > /dev/null 2>&1
sudo chmod +x /usr/local/dvs/$file
sudo mkdir /var/lib/dvswitch/dvs/adv/user00 > /dev/null 2>&1
sudo wget -O /var/lib/dvswitch/dvs/adv/user00/dvsm.macro https://raw.githubusercontent.com/hp3icc/DVSMU/main/dvsm.macro > /dev/null 2>&1
sudo wget -O /var/lib/dvswitch/dvs/adv/user00/dvsm.adv https://raw.githubusercontent.com/hp3icc/DVSMU/main/dvsm.adv > /dev/null 2>&1
echo "----------------------------------------------------"
sudo wget -O /var/lib/dvswitch/dvs/adv/user00/dvsm.basic https://raw.githubusercontent.com/hp3icc/DVSMU/main/dvsm.basic > /dev/null 2>&1
sudo wget -O /var/lib/dvswitch/dvs/adv/user00/dvsm.sh https://raw.githubusercontent.com/hp3icc/DVSMU/main/dvsm.sh > /dev/null 2>&1
sudo chmod +x /var/lib/dvswitch/dvs/adv/user00/dvsm.sh
echo "----------------------------------------------------"
sudo mkdir /var/lib/dvswitch/dvs/adv/user00EN > /dev/null 2>&1
sudo mkdir /var/lib/dvswitch/dvs/adv/user00KR > /dev/null 2>&1
files="adv_audio.txt adv_dmr.txt adv_hotspot.txt adv_main.txt adv_managetg.txt adv_resetfvrt.txt adv_rxgain.txt adv_tgref.txt adv_tools.txt adv_txgain.txt"
for file in $files; do
sudo wget -O /var/lib/dvswitch/dvs/adv/user00EN/$file https://raw.githubusercontent.com/hp3icc/DVSMU/main/EN/$file > /dev/null 2>&1
sudo wget -O /var/lib/dvswitch/dvs/adv/user00KR/$file https://raw.githubusercontent.com/hp3icc/DVSMU/main/KR/$file > /dev/null 2>&1
echo "----------------------------------------------------"
done
sudo wget -O /usr/local/dvs/man_log https://raw.githubusercontent.com/hp3icc/DVSMU/main/man_log > /dev/null 2>&1
sudo chmod +x /usr/local/dvs/man_log
file=/etc/crontab
cron_daily_time=$(sed -n -e '/cron.daily/p' $file | cut -f 2 -d' ')
cron_daily_time=$(echo $cron_daily_time | cut -f1 -d' ')
cron_daily_min=$(sed -n -e '/cron.daily/p' $file | cut -f 1 -d' ')
cron_daily_min_plus_3=$((cron_daily_min + 3))
cron_daily_min_plus_4=$((cron_daily_min + 4))
echo "reboot=yes" | sudo tee -a $file > /dev/null 2>&1
echo "time=3" | sudo tee -a $file > /dev/null 2>&1
echo "0 3 * * * root /usr/local/dvs/man_log" | sudo tee -a $file > /dev/null 2>&1
echo "$cron_daily_min_plus_3 $cron_daily_time * * * root /usr/local/dvs/DMRIds_chk.sh" | sudo tee -a $file > /dev/null 2>&1
echo "------------- Please Wait 10 sec -----------------"
sudo apt-get update > /dev/null 2>&1
echo "----------------------------------------------------"
sudo apt-get install multitail > /dev/null 2>&1
#--------------------------------------------------------
path=$(echo $PATH)
if [[ "$path" =~ "dvs" ]]; then
echo "------------------ FINISHED ----------------------"
echo
echo "---------------- run < dvsmu > -------------------"
echo
echo
sudo rm setup.sh > /dev/null 2>&1
exit 0
else
echo "------------------ FINISHED ----------------------"
echo
echo "--------- After rebooting, <dvsmu> can be run -------------"
echo
echo "---------- do you want to reboot? (y/n) --------------"
read reply
if [ "$reply" = Y ] || [ "$reply" = y ] || [ "$reply" = "" ]; then
clear
echo
echo
echo
echo
echo "------------- The SSH connection is lost. ---------------"
echo
echo "------------- Please reconnect after a while. -------------"
echo
echo
sudo rm setup > /dev/null 2>&1
sudo reboot
fi
exit 0
fi
#--------------------------------------------------------