Image

Image

Search This Blog

Tuesday, September 16, 2008

process_unix
Posted by rain on October 18th, 2007

#! /bin/bash
#echo passwd and aliases are transfered by ftp every hour.
cd /etc/initsetup
rm -f exchange_recipients
cut -d: -f1 passwd >> maillist
cut -d: -f1 aliases >> maillist
while read user; do echo “$user@fakedomain.com OK”>>exchange_recipients; donerm -f maillist
cp exchange_recipients /etc/postfix/
/usr/sbin/postmap /etc/postfix/exchange_recipients &>/dev/null
/usr/sbin/postfix reload &>/dev/null
wc -l passwd > tmpnr
nr=`cut -dp -f1 tmpnr`
realnr=$(($nr-19))
rm -f tmpn*
echo “$HOSTNAME users: $realnr” > usernr
echo -en “Expire on: ” >> usernr
grep expd /etc/initsetup/vardt | cut -d= -f2 >> usernr

No comments:

Post a Comment

Blog Archive