Adding upstream version 1.34.4.
Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
parent
e393c3af3f
commit
4978089aab
4963 changed files with 677545 additions and 0 deletions
24
scripts/deb/pre-install.sh
Normal file
24
scripts/deb/pre-install.sh
Normal file
|
@ -0,0 +1,24 @@
|
|||
#!/bin/bash
|
||||
|
||||
if ! grep "^telegraf:" /etc/group &>/dev/null; then
|
||||
groupadd -r telegraf
|
||||
fi
|
||||
|
||||
if ! id telegraf &>/dev/null; then
|
||||
useradd -r -M telegraf -s /bin/false -d /etc/telegraf -g telegraf
|
||||
fi
|
||||
|
||||
if [[ -d /etc/opt/telegraf ]]; then
|
||||
# Legacy configuration found
|
||||
if [[ ! -d /etc/telegraf ]]; then
|
||||
# New configuration does not exist, move legacy configuration to new location
|
||||
echo -e "Please note, Telegraf's configuration is now located at '/etc/telegraf' (previously '/etc/opt/telegraf')."
|
||||
mv -vn /etc/opt/telegraf /etc/telegraf
|
||||
|
||||
if [[ -f /etc/telegraf/telegraf.conf ]]; then
|
||||
backup_name="telegraf.conf.$(date +%s).backup"
|
||||
echo "A backup of your current configuration can be found at: /etc/telegraf/${backup_name}"
|
||||
cp -a "/etc/telegraf/telegraf.conf" "/etc/telegraf/${backup_name}"
|
||||
fi
|
||||
fi
|
||||
fi
|
Loading…
Add table
Add a link
Reference in a new issue