summaryrefslogtreecommitdiff
path: root/localmaildomainupdate
blob: d46aaa1ffd9aca54b37d43c8e813981dde6306a7 (plain)
  1. #!/bin/sh
  2. #
  3. # /usr/local/sbin/localmaildomainupdate
  4. # Copyright 2004 Jonas Smedegaard <dr@jones.dk>
  5. #
  6. # $Id: localmaildomainupdate,v 1.3 2006-05-05 10:31:13 jonas Exp $
  7. #
  8. # Update an (already prepared!) mailuser file
  9. #
  10. # (wrapper script for localmkpostfixvirtual)
  11. #
  12. set -e
  13. if [ $# -ge 1 ]; then
  14. maildomain="$1"
  15. virtualfile="virtual-$1"
  16. shift
  17. else
  18. maildomain=""
  19. virtualfile="virtual"
  20. fi
  21. (
  22. cd /etc/postfix
  23. diff $@ $virtualfile $virtualfile.new || if [ $? = 1 ]; then /bin/true; fi
  24. echo -n "Above is the intended changes. OK to update (y/N)? "
  25. read do_update
  26. case $do_update in
  27. y|Y)
  28. mv $virtualfile.new $virtualfile
  29. postmap $virtualfile
  30. ;;
  31. esac
  32. )