summaryrefslogtreecommitdiff
path: root/localmaildomainupdate
blob: 544f0ae652bf054ede683eb580e300ea5b167794 (plain)
  1. #!/bin/sh
  2. #
  3. # /usr/local/sbin/localmaildomainupdate
  4. # Copyright 2004 Jonas Smedegaard <dr@jones.dk>
  5. #
  6. # $Id: localmaildomainupdate,v 1.1 2004-08-19 14:40:32 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
  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. )