#!/bin/bash [[ -z $1 ]] && echo domain as \$1 missing && exit 1 cd /etc/postfix/ echo -n checking if $1 is already recorded... tmp=`grep $1 client_access` [[ -n $tmp ]] && printf "ALREADY RECORDED\n$tmp\n" && exit 1 || echo done unset tmp echo -n writing to access... cat >> client_access <