~ubuntu-branches/ubuntu/natty/dpsyco/natty

« back to all changes in this revision

Viewing changes to skel/src/update-dpsyco-users-skel

  • Committer: Bazaar Package Importer
  • Author(s): Ola Lundqvist
  • Date: 2002-04-08 20:41:30 UTC
  • Revision ID: james.westby@ubuntu.com-20020408204130-aumsesgfm39nwyb0
Tags: 1.0.10
* Added documentation from Machael Boman
  <michael.boman@securecirt.com>, closes: #128120.
* Fixed purge problem, moved deconfiguring to prerm from postinst,
  closes: #141732.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/sh
 
2
# DocumentId:   $Id: update-dpsyco-users-skel,v 1.19 2001/12/07 15:17:13 ola Exp $
 
3
# Author:       $Author: ola $
 
4
# Date:         $Date: 2001/12/07 15:17:13 $
 
5
# Summary:
 
6
#       Updates the dpsyco base users skeleton, and patch if needed.
 
7
 
 
8
# Read the default dpsyco config.
 
9
. /etc/dpsyco/defaults.conf
 
10
. /usr/share/dpsyco/change.func
 
11
. /usr/share/dpsyco/owner.func
 
12
 
 
13
TESTNFS="/ $DHOME /etc"
 
14
. /usr/share/dpsyco/checknfs.test
 
15
 
 
16
# Users that exist in password file.
 
17
EUSERS=$(grep "^[^:]*:[^:]*:$UID_MATCH:" $PWDF | sed -e "s|:.*||g;")
 
18
 
 
19
for U in $EUSERS ; do
 
20
    . $USERSC
 
21
    if [ -f $USERSRC/$U ] ; then
 
22
        . $USERSRC/$U
 
23
    fi
 
24
    if [ -d "$DHOME/$U" ] ; then
 
25
        if [ -d "$USERSKELSRC" ] ; then
 
26
            rsync -rlptD -I "$USERSKELSRC/" /etc/skel
 
27
            dpsyco-skel "$USERSKELSRC/" "$DHOME/$U"
 
28
        fi
 
29
        changeowner $U $U "$DHOME/$U"
 
30
        if [ ! -z "$EMAIL" ] ; then
 
31
            PROFILE="$DHOME/$U/.bash_profile"
 
32
            if grep "^EMAIL=" /dev/null 2>&1 ; then
 
33
                changefile "s|\(EMAIL=.*\)|export \1|;" $PROFILE
 
34
            fi
 
35
            if grep "export[[:space:]][[:space:]]*EMAIL=" $PROFILE > /dev/null 2>&1 ; then
 
36
                if ! grep grep "export[[:space:]][[:space:]]*EMAIL='$EMAIL'" $PROFILE > /dev/null 2>&1 ; then
 
37
                    changefile "s|export[[:space:]][[:space:]]*EMAIL=.*|export EMAIL='$EMAIL'|;" $PROFILE
 
38
                fi
 
39
            else
 
40
                echo "export EMAIL='$EMAIL'" >> $PROFILE
 
41
            fi
 
42
        fi
 
43
    fi
 
44
done