#!/bin/sh SNMP_DIR="/var/lib/snmp" SNMP_USER="Debian-snmp" SNMP_GROUP="$SNMP_USER" SNMP_SHELL="/bin/false" SNMPD_CONF="/etc/snmp/snmpd.conf" set -e case "$1" in configure) . /usr/share/debconf/confmodule db_version 2.0 adduser --quiet --system --group --home "$SNMP_DIR" \ --disabled-password --disabled-login \ --shell "$SNMP_SHELL" --force-badname "$SNMP_USER" # care if SNMP_DIR is used by previous "snmp" user chown "$SNMP_USER":"$SNMP_GROUP" "$SNMP_DIR" if [ -f "$SNMP_DIR/snmpd.conf" ]; then chown "$SNMP_USER":"$SNMP_GROUP" "$SNMP_DIR/snmpd.conf" fi # Change group of snmpd.conf to SNMP_GROUP #998152 # This is so its group readable for snmpd reload if [ -f $SNMPD_CONF ]; then chgrp "$SNMP_GROUP" $SNMPD_CONF fi # Bug#709087 DOCDIR=/usr/share/doc/snmpd DOCLINK=libsnmp30 if [ -d $DOCDIR ] && [ ! -L $DOCDIR ]; then rmdir $DOCDIR ln -s $DOCLINK $DOCDIR fi ;; abort-upgrade|abort-remove|abort-deconfigure) ;; *) echo "postinst called with unknown argument \`$1'" >&2 exit 1 ;; esac # dh_installdeb will replace this with shell code automatically # generated by other debhelper scripts. #DEBHELPER# exit 0