forked from alhazred/solaris-scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
forwardchk.sh
52 lines (44 loc) · 1.43 KB
/
forwardchk.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#!/bin/sh
### To check users home directory for invalid .forward file
### Vinoth 19.10.2000 (vinothu@hotmail.com)
### DEFINE DIR 1st LINE & DOMAIN NAME IN 2ND(domain) LINE
dir="/home2"
domain="test.com"
path=`ls -l $dir | grep "^d" | awk '{print $9}'`
log="$dir/frwdlog"
tput blink
echo " ";echo "Developed by - Vinoth - vinothu@hotmail.com";echo " "
tput rmso
cd "$dir"
for x in `echo $path`
do
cd $x
echo "entering in to $x dir."
if [ -f .forward ]
then
chk=`cat .forward | cut -d"@" -f2-`
if [ "$chk" = "$domain" ]
then
echo "not found"
else
echo ".forward found in $x's directory"
echo ".forward found in $x's directory" >> $log
cat .forward >> $log
echo "----------------------------------------------------------" >> $log
echo " " >> $log
fi
fi
cd ..
done
echo " ";echo " ";echo "Check $log file for more information"
##############################################################################
### This script is submitted to BigAdmin by a user of the BigAdmin community.
### Sun Microsystems, Inc. is not responsible for the
### contents or the code enclosed.
###
###
### Copyright 2006 Sun Microsystems, Inc. ALL RIGHTS RESERVED
### Use of this software is authorized pursuant to the
### terms of the license found at
### http://www.sun.com/bigadmin/common/berkeley_license.html
##############################################################################