Project

General

Profile

« Previous | Next » 

Revision 459cdb00

Added by Andreas Kohlbecker about 12 years ago

fixing problem with finding user and groups & possible fix for #2492 (LINUX: insufficient permissions for user cdm to create logfiles)

View differences:

src/main/installer/linux/postinst
22 22
# functions
23 23
#
24 24
userExist(){
25
    grep $1 /etc/passwd > /dev/null
25
    grep "$1:" /etc/passwd > /dev/null
26 26
    [ $? -eq 0 ] && return $TRUE || return $FALSE
27 27
}
28 28

  
29 29
groupExist(){
30
    grep $1 /etc/group > /dev/null
30
    grep "$1:" /etc/group > /dev/null
31 31
    [ $? -eq 0 ] && return $TRUE || return $FALSE
32 32
}
33 33

  
......
53 53
    #
54 54
    if ( groupExist $CDM_GROUP  )
55 55
    then
56
      echo "user '$CDM_GROUP' alreday exists"
56
      echo "group '$CDM_GROUP' alreday exists"
57 57
    else
58 58
      echo "creating group '$CDM_GROUP'"
59 59
      groupadd $CDM_GROUP
......
81 81
    #
82 82
    if [ ! -d $CDM_LOG ]; then
83 83
        mkdir -p $CDM_LOG
84
        chown -R $CDM_USER:adm $CDM_LOG
85 84
    fi
85
    chown -R $CDM_USER:adm $CDM_LOG
86 86

  
87 87
    #
88 88
    # copy template .cdmLibrary if not yet existing into

Also available in: Unified diff