Skip to content
Snippets Groups Projects
Commit 82233369 authored by Kali Hernandez's avatar Kali Hernandez Committed by Cameron Sparr
Browse files

Debian package: check for group before useradd (#2107)

Fixes #2106
parent d7a8bb22
No related branches found
No related tags found
No related merge requests found
...@@ -26,7 +26,12 @@ function install_chkconfig { ...@@ -26,7 +26,12 @@ function install_chkconfig {
id telegraf &>/dev/null id telegraf &>/dev/null
if [[ $? -ne 0 ]]; then if [[ $? -ne 0 ]]; then
useradd -r -K USERGROUPS_ENAB=yes -M telegraf -s /bin/false -d /etc/telegraf grep "^telegraf:" /etc/group &>/dev/null
if [[ $? -ne 0 ]]; then
useradd -r -K USERGROUPS_ENAB=yes -M telegraf -s /bin/false -d /etc/telegraf
else
useradd -r -K USERGROUPS_ENAB=yes -M telegraf -s /bin/false -d /etc/telegraf -g telegraf
fi
fi fi
test -d $LOG_DIR || mkdir -p $LOG_DIR test -d $LOG_DIR || mkdir -p $LOG_DIR
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment