File: ii-shellrc

package info (click to toggle)
systraq 0.0.20070301-4
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 1,392 kB
  • ctags: 13
  • sloc: sh: 792; makefile: 116
file content (51 lines) | stat: -rw-r--r-- 1,598 bytes parent folder | download | duplicates (6)
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
51
#!/bin/sh -e

# $Id: ii-shellrc 195 2005-02-05 15:20:47Z joostvb $
# $URL: svn+ssh://svn.debian.org/svn/systraq/trunk/systraq/lib/ii-shellrc $

# Copyright (C) 2001, 2002, 2003, 2004 Joost van Baal
#
# This file is part of systraq.  Systraq is free software; you can redistribute
# it and/or modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of the License,
# or (at your option) any later version.  You should have received a copy of
# the GNU General Public License along with this file (see COPYING).

for h in `cut -d: -f6 /etc/passwd | sort -u`
do
    [ -d $h ] && HOMES="$HOMES $h"
done

SH_files="/etc/profile /etc/csh.cshrc /etc/csh.login /etc/bash.bashrc \
 /etc/zshenv /etc/zprofile /etc/zshrc /etc/zlogin /etc/zlogout \
 /etc/zsh-beta/zshenv /etc/zsh-beta/zprofile /etc/zsh-beta/zshrc \
 /etc/zsh-beta/zlogin /etc/zsh-beta/zlogout"
for f in $SH_files
do
    [ -f $f ] && SH_FILES="$SH_FILES $f"
done

SH_HOME=".profile .cshrc .tcshrc .login .logout .bash_profile .bashrc \
 .bash_login .bash_logout .klogin .zshenv .zprofile .zshrc .zlogin .zlogout"

HOMES="$HOMES /etc/skel"
for h in $HOMES
do
    for f in $SH_HOME
    do
        [ -f $h/$f ] && SH_FILES="$SH_FILES $h/$f"
    done
done

echo
echo 'check if umask (002 or 022 please) and PATH (no dot please) are sane'
for f in $SH_FILES
do
    if egrep umask\|PATH $f | grep -v '^#' | grep -v '^umask 0[02]2$' >/dev/null
    then
        echo 
        echo found in file $f:
        egrep umask\|PATH $f | grep -v '^#' | grep -v '^umask 0[02]2$'
    fi
done