-
Notifications
You must be signed in to change notification settings - Fork 0
/
update_tetra_users.sh
34 lines (30 loc) 路 1.12 KB
/
update_tetra_users.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
#!/bin/bash
# Script and files by HamTetra-CT Dev Team
# Intended to be used with "SVXLink tetra-contrib" by DL1HRC
# Auto-fecht and updates local tetra_users.json file from github
echo "A inicializar..."
sudo systemctl stop svxlink
sleep 2
echo "Script provided by HamTetra-CT Dev Team & made by Francisco Carmo F4VSE / CT7AJM"
sleep 3
# Download the latest version of the file from GitHub
echo "A iniciar transfer锚ncia do novo ficheiro tetra_users..."
wget -q https://raw.githubusercontent.com/HamTetra-CT/users_update/main/tetra_users.json -O /tmp/tetra_users.json
sleep 1
# Compare the contents of the two files
echo "A comparar vers玫es..."
sleep 1
if ! cmp -s /tmp/tetra_users.json /etc/svxlink/tetra_users.json; then
echo "Nova vers茫o encontrada!"
# Replace the local file with the updated version
echo "A nova vers茫o foi instalada com sucesso!"
sudo cp /tmp/tetra_users.json /etc/svxlink/tetra_users.json
sleep 1
# Delete the temporary file
echo "Limpeza dos ficheiros da atualiza莽茫o..."
sudo rm /tmp/tetra_users.json
sleep 1
fi
echo "Atualiza莽茫o terminada com sucesso!"
sudo systemctl start svxlink
sleep 1