-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
49 lines (40 loc) · 2.36 KB
/
install.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
#!/bin/bash
# This is the entry point for setting up a worker. Download and run this script on a fresh Ubuntu 22.04 server.
# Make sure the new server has access to the NFS /share (see below). It's safe to run this more than once; in case you forgot.
curl -s https://golift.io/repo.sh | sudo bash -s - notifiarr
echo "Adding Nonpublic Golift APT repo"
curl -sL https://packagecloud.io/golift/nonpublic/gpgkey | gpg --dearmor > /tmp/golift-nonpublic-keyring.gpg && \
sudo mv -f /tmp/golift-nonpublic-keyring.gpg /usr/share/keyrings/golift-nonpublic-keyring.gpg
echo "deb [signed-by=/usr/share/keyrings/golift-nonpublic-keyring.gpg] https://packagecloud.io/golift/nonpublic/ubuntu focal main" | \
sudo tee /etc/apt/sources.list.d/golift-nonpublic.list
sudo add-apt-repository -y ppa:ondrej/php
sudo apt install -y notifiarr-worker
if ! grep -q /share /etc/fstab ; then
echo "Adding /share mount to /etc/fstab:"
echo "10.1.0.92:/volume1/data/share /share nfs rw,noatime,norelatime,async,vers=4.0,rsize=131072,wsize=131072,soft,sec=sys,auto 0 0" | \
sudo tee -a /etc/fstab
fi
if [ ! -d /share/workers ]; then
sudo mkdir -p /share
sudo mount /share
fi
if [ -f /share/workers/defaults/notifiarr.conf ] && \
! diff -s /etc/notifiarr/notifiarr.conf /share/workers/defaults/notifiarr.conf >/dev/null; then
echo "Installing notifiarr.conf and restarting the client"
sudo cp /share/workers/defaults/notifiarr.conf /etc/notifiarr/
sudo systemctl restart notifiarr
fi
if [ -f /share/workers/defaults/datadog-api-key.txt ] && [ ! -d /etc/datadog-agent ]; then
echo "Installing datadog agent."
DD_API_KEY=$(head -n1 /share/workers/defaults/datadog-api-key.txt) \
DD_SITE="datadoghq.com" \
DD_APM_INSTRUMENTATION_ENABLED=host \
bash -c "$(curl -L https://s3.amazonaws.com/dd-agent/scripts/install_script_agent7.sh)"
fi
if [ -d /etc/datadog-agent ] && [ ! -f /etc/datadog-agent/environment ]; then
echo "Creating Datadog environment config file: /etc/datadog-agent/environment"
echo "DD_PROCESS_AGENT_ENABLED=true" | sudo tee /etc/datadog-agent/environment
echo "DD_SYSTEM_PROBE_NETWORK_ENABLED=true" | sudo tee -a /etc/datadog-agent/environment
echo "DD_PROCESS_CONFIG_PROCESS_COLLECTION_ENABLED=true" | sudo tee -a /etc/datadog-agent/environment
sudo systemctl restart datadog-agent
fi