Changeset 1181 for dasscm/trunk/etc


Ignore:
Timestamp:
Jun 10, 2015, 9:38:33 PM (10 years ago)
Author:
joergs
Message:

only run on login shells (if $HOME is defined),
make it work also with dash instead of bash.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • dasscm/trunk/etc/profile.d/dasscm.sh

    r1122 r1181  
    55CONFIG="/etc/dasscm.conf"
    66
    7 if [ -r $CONFIG ]; then
    8     source $CONFIG
     7if [ "$HOME" ]; then
     8        if [ -r $CONFIG ]; then
     9        . $CONFIG
    910
    10     # check if a warn message is wanted
    11     # and dasscm is already configured ($DASSCM_REPOSITORY_NAME)
    12     if [ "$DASSCM_STATUS_AT_SHELL_LOGIN" = "yes" -a -n "$DASSCM_REPOSITORY_NAME" ]; then
     11        # check if a warn message is wanted
     12        # and dasscm is already configured ($DASSCM_REPOSITORY_NAME)
     13        if [ "$DASSCM_STATUS_AT_SHELL_LOGIN" = "yes" -a -n "$DASSCM_REPOSITORY_NAME" ]; then
    1314
    14         # check if write permissions are given
    15         if [ -w "${DASSCM_LOCAL_REPOSITORY_BASE}/${DASSCM_REPOSITORY_NAME}" ]; then
     15                # check if write permissions are given
     16                if [ -w "${DASSCM_LOCAL_REPOSITORY_BASE}/${DASSCM_REPOSITORY_NAME}" ]; then
    1617
    17             # get dasscm status
    18             # and print it, if a result is given
    19             RESULT=`dasscm status`
    20             if [ $? -ne 0 ]; then
    21                 printf "* DASSCM warnings *\n"
    22                 printf "$RESULT\n"
    23                 printf "* please use dasscm to check-in these changes *\n"
    24             fi
    25         fi
    26     fi
     18                        # get dasscm status
     19                        # and print it, if a result is given
     20                        RESULT=`dasscm status`
     21                        if [ $? -ne 0 ]; then
     22                                printf "* DASSCM warnings *\n"
     23                                printf "$RESULT\n"
     24                                printf "* please use dasscm to check-in these changes *\n"
     25                        fi
     26                fi
     27        fi
     28        fi
    2729fi
Note: See TracChangeset for help on using the changeset viewer.