-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathinstall-remote_syslog2.sh
More file actions
executable file
·44 lines (32 loc) · 1006 Bytes
/
install-remote_syslog2.sh
File metadata and controls
executable file
·44 lines (32 loc) · 1006 Bytes
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
#!/bin/sh
set -e
if [ $(id -u) -ne 0 ] ; then
echo "Error : this script requires sudo"
exit 16
fi
TARGET_FILE=remote_syslog_linux_amd64.tar.gz
ARCHIVE_URL=https://github.com/papertrail/remote_syslog2/releases/download/v0.16/${TARGET_FILE}
wget -O ${TARGET_FILE} $ARCHIVE_URL
#curl -o ${TARGET_FILE} ${ARCHIVE_URL}
tar -xvf ${TARGET_FILE}
cp ./remote_syslog/remote_syslog /usr/local/bin
rm -rf ./remote_syslog
#rm remote_syslog_linux_amd64.tar.gz
# see https://github.com/papertrail/remote_syslog2/blob/master/examples/remote_syslog.systemd.service
cat << EOF > /etc/systemd/system/remote_syslog.service
[Unit]
Description=remote_syslog2
Documentation=https://github.com/papertrail/remote_syslog2
After=rsyslog.service
[Service]
ExecStartPre=/usr/bin/test -e /etc/log_files.yml
ExecStart=/usr/local/bin/remote_syslog -D
Restart=always
User=root
Group=root
[Install]
WantedBy=multi-user.target
EOF
systemctl enable remote_syslog.service
systemctl start remote_syslog.service
echo "Success"