File: CheckConfig

package info (click to toggle)
tripwire 1.2-15
  • links: PTS
  • area: non-free
  • in suites: slink
  • size: 1,428 kB
  • ctags: 866
  • sloc: ansic: 7,938; sh: 1,316; makefile: 425; yacc: 413; lex: 133; perl: 101
file content (31 lines) | stat: -rwxr-xr-x 618 bytes parent folder | download | duplicates (3)
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
#!/bin/sh
# "analyze" a config file 
#
# Lance Bailey <lrb@ctrg.rri.uwo.ca>
#

if [ ".$1" = ".-v" ];then verbose="yes";shift
else verbose="";fi

file="$1"

sed -e "s/#.*//" \
    -e "/^$/d" \
    -e "s=[^/]*\(/[^ 	]*\).*=\1=" \
    $file |
    while read line
    do if [ ! -s $line ];then
           if [ $verbose ];then echo ${line}:	not found;fi
           continue
       fi
    
       case `ls -ld $line` in
           d*) if [ $verbose ];then echo "${line}:	directory";fi ;;
           l*) echo "${line}:	symlink";;
           *)  if [ $verbose ];then echo "${line}:	file";fi ;;
       esac
    done

#
# EOF
#