-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathupdate.sh
38 lines (31 loc) · 1.2 KB
/
update.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
#!/bin/bash
echo "Updating sentinel agent"
# Check if the directory doesn't exist
if [ ! -d "/opt/sentinel-agent" ]; then
echo "Directory /opt/sentinel-agent doesn't exist."
exit 1
fi
# Check CPU architecture
arch=$(uname -m)
if [[ "$arch" == "x86_64" ]]; then
echo "AMD architecture detected."
wget https://github.com/SumanSynth/sentinel-agent-setup/releases/download/v1.0.2/sentinel-agent-linux-amd64
elif [[ "$arch" == "arm64" || "$arch" == "aarch64" ]]; then
echo "ARM architecture detected."
wget https://github.com/SumanSynth/sentinel-agent-setup/releases/download/v1.0.2/sentinel-agent-linux-arm64
sudo mv sentinel-agent-linux-arm64 sentinel-agent-linux-amd64
else
echo "Unknown architecture: $arch"
exit 1
fi
sudo mv sentinel-agent-linux-amd64 /opt/sentinel-agent/
sudo chmod +x /opt/sentinel-agent/sentinel-agent-linux-amd64
# Enable the service to start on boot
echo "Enabling the sentinel service to start on boot"
sudo systemctl enable sentinel-agent.service
# Start the service
echo "Restarting the sentinel service"
sudo systemctl restart sentinel-agent.service
# Check the status of the service
echo "Checking the status of the sentinel service"
sudo systemctl status sentinel-agent.service