summaryrefslogtreecommitdiff
path: root/localmaildomainupdate
blob: a72364995c12787d3d59291eb3de4be5192dc99c (plain)
  1. #!/bin/sh
  2. #
  3. # /usr/local/sbin/localmaildomainupdate
  4. # Copyright 2004 Jonas Smedegaard <dr@jones.dk>
  5. #
  6. # $Id: localmaildomainupdate,v 1.2 2004-12-07 16:04:14 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. )