mailwolt/scripts/mailwolt-sandbox-sync

14 lines
344 B
Bash

#!/bin/bash
# Writes /etc/postfix/transport.sandbox from a temp file and runs postmap.
# Usage: mailwolt-sandbox-sync <tempfile>
set -e
DEST="/etc/postfix/transport.sandbox"
SRC="$1"
if [[ -z "$SRC" || ! -f "$SRC" ]]; then
echo "Usage: mailwolt-sandbox-sync <tempfile>" >&2
exit 1
fi
cp "$SRC" "$DEST"
chmod 644 "$DEST"
postmap "$DEST"