-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed install/remove of telegraf on non-systemd Debian/Ubuntu systems (…
- Loading branch information
1 parent
7e07d17
commit c0daa68
Showing
5 changed files
with
81 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,16 @@ | ||
#!/bin/bash | ||
|
||
if [[ -f /etc/opt/telegraf/telegraf.conf ]]; then | ||
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 /etc/opt/telegraf /etc/telegraf | ||
# 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 | ||
|
||
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 | ||
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters