_amanda_uid='112'
_amanda_gid='112'

post_install() {
  if [[ -z $(getent group amanda) ]] ; then
    groupadd -g $_amanda_gid amanda
  fi
  if [[ -z $(getent passwd amanda) ]] ; then
    useradd -u $_amanda_uid -g amanda -G storage,disk -m -d /var/amanda -s /bin/bash -c "Amanda Backup Daemon" amanda
  fi
  
  cat << EOT
amanda: Visit the Amanda wiki to configure your backup sets:"
amanda:   http://wiki.zmanda.com/index.php/Quick_start#Configuring_the_backup_server"
amanda: Examples are in /etc/amanda/examples/

amanda: The daemon is run by xinetd so restart xinetd to start the daemon listening for connections.
EOT
}

post_upgrade() {
  post_install $1
}

pre_remove() {
  userdel amanda &> /dev/null
  groupdel amanda &> /dev/null
}

op=$1
shift
$op $*

# vim:set ts=2 sw=2 et:
