scan-scm-svc-user.sh

scan-scm-svc-user.sh

#! /bin/sh
export LC_ALL=zh_CN.UTF-8
cd /bin2/
sh scan-scm-svc-user-daily.sh > scan-scm-svc-user-daily.sh.log 2>&1
/usr/bin/mutt -s "scan-scm-svc-user-daily" scm-svr-mtr@scm5.***.cn < scan-scm-svc-user-daily.sh.log

scan-scm-svc-user-daily.sh

#!/bin/sh 
if [ -f scan-scm-svc-user3.txt ] 
then 
rm -f scan-scm-svc-user3.txt 
fi 
if [ -f scan-scm-svc-user1.txt ] 
then 
rm -f scan-scm-svc-user1.txt 
fi 
if [ -f scan-scm-svc-user4.txt ] 
then 
rm -f scan-scm-svc-user4.txt 
fi

find /cvsroot/ -follow -name passwd -exec cat {} > scan-scm-svc-user1.txt ; 
sed -i "s/:/n:/" scan-scm-svc-user1.txt 
sed -i "/^:/"d scan-scm-svc-user1.txt 
sed -i "/^#/"d scan-scm-svc-user1.txt 
cat /usr/etc/proftpd1/passwd >> scan-scm-svc-user1.txt 
cat /usr/etc/proftpd2/passwd >> scan-scm-svc-user1.txt 
cat /usr/etc/proftpd3/passwd >> scan-scm-svc-user1.txt 
cat /usr/etc/proftpd4/passwd >> scan-scm-svc-user1.txt 
sed -i "s/:/n:/" scan-scm-svc-user1.txt 
sed -i "/^:/"d scan-scm-svc-user1.txt 
sed -i "/^#/"d scan-scm-svc-user1.txt 
find /cruisecontrol/projects/ -name "*.xml" -exec grep 'mailto.*@.*' {} ; >> scan-scm-svc-user1.txt 
sed -i 's/(.*)"(.*)"(.*)/2/g' scan-scm-svc-user1.txt 
sed -i "/@scm5.***.cn$/"d scan-scm-svc-user1.txt 
#sed -i "s/@***.cn//" scan-scm-svc-user1.txt 
sed -i "s/@/./" scan-scm-svc-user1.txt 
sed -i "/^test/"d scan-scm-svc-user1.txt 
sed -i "/^cvstrain/"d scan-scm-svc-user1.txt 
sed -i "/^builder/"d scan-scm-svc-user1.txt 
sed -i "/^yangyang.***.com$/"d scan-scm-svc-user1.txt 
sort scan-scm-svc-user1.txt | uniq - scan-scm-svc-user3.txt 
echo "***账号总数***" 
cat scan-scm-svc-user3.txt | wc -l 
echo "." 
echo "***字母大写的账号***" 
grep [A-Z] scan-scm-svc-user3.txt 
echo "." 
echo "***账号变化***" 
diff scan-scm-svc-user3.txt scan-scm-svc-user.txt 
cat scan-scm-svc-user3.txt > scan-scm-svc-user.txt

cat scan-scm-svc-user.txt > scan-scm-svc-user.at.txt 
sed -i "s/.***.com/@***.com/" scan-scm-svc-user.at.txt 
sed -i "s/.***.com/@***.com/" scan-scm-svc-user.at.txt 
sed -i "s/.***.com/@***.com/" scan-scm-svc-user.at.txt 
sed -i "s/.***.com/@***.com/" scan-scm-svc-user.at.txt 
sed -i "s/.***.com/@***.com/" scan-scm-svc-user.at.txt 
sed -i "s/.***.com.cn/@***.com.cn/" scan-scm-svc-user.at.txt 
sed -i "s/.***.com/@***.com/" scan-scm-svc-user.at.txt 
sed -i "s/.***.com/@***.com/" scan-scm-svc-user.at.txt 
sed -i "s/.***.com/@***.com/" scan-scm-svc-user.at.txt 
sed -i "s/.***.cn/@***.cn/" scan-scm-svc-user.at.txt 
sed -i "s/.***.com/@***.com/" scan-scm-svc-user.at.txt 
sed -i "s/.***.com/@***.com/" scan-scm-svc-user.at.txt 
sed -i "s/.***.cn/@***.cn/" scan-scm-svc-user.at.txt 
sed -i "s/.***.com/@***.com/" scan-scm-svc-user.at.txt 
sed -i "s/.***.cn/@***.cn/" scan-scm-svc-user.at.txt

echo "." 
echo "***帐号不是集团的邮箱***" 
grep -v -E '.***.com$|.***.com$|.***.com$|.***.com$|.***.com$|.***.com$|.***.cn$|.***.com$|.***.cn$|.***.com$|.***.com$|.***.com.cn$|.***.com$|.***.cn$|.***.com$' scan-scm-svc-user.txt

你可能感兴趣的:(scan-scm-svc-user.sh)