#!/bin/sh # # /usr/local/sbin/localmaildomainupdate # Copyright 2004 Jonas Smedegaard # # $Id: localmaildomainupdate,v 1.1 2004-08-19 14:40:32 jonas Exp $ # # Update an (already prepared!) mailuser file # # (wrapper script for localmkpostfixvirtual) # set -e if [ $# -ge 1 ]; then maildomain="$1" virtualfile="virtual.$1" shift else maildomain="" virtualfile="virtual" fi ( cd /etc/postfix diff $@ $virtualfile $virtualfile.new echo -n "Above is the intended changes. OK to update (y/N)? " read do_update case $do_update in y|Y) mv $virtualfile.new $virtualfile postmap $virtualfile ;; esac )