#!/bin/sh set -e if [ "$1" = "configure" ]; then USER="nagbot" # Create the "nagbot" user if ! getent passwd ${USER} > /dev/null 2>&1 then adduser --quiet --system --group --home /var/lib/${USER} \ --no-create-home \ --shell /bin/false \ --gecos "${USER} daemon" ${USER} fi # Create the "nagbot" group if it is missing and set the primary group # of the "nagbot" user to this group. if ! getent group ${USER} > /dev/null 2>&1 then addgroup --quiet --system ${USER} usermod -g ${USER} ${USER} fi chown -R ${USER}. /etc/${USER} /var/lib/${USER} chmod 0750 /etc/${USER} fi #DEBHELPER#