Ignore:
Timestamp:
Mar 28, 2008, 9:14:40 PM (17 years ago)
Author:
ecprice
Message:

Improve postinst script to not give errors.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/packages/sipb-xen-database/sipb-xen-database/debian/sipb-xen-database-server.postinst

    r81 r295  
    2121case "$1" in
    2222    configure)
    23         # Don't fail if the user/database already exists
    24         su postgres -c 'createuser sipb-xen -S -d -R'    || true
    25         su postgres -c 'createdb sipb_xen -O sipb-xen'   || true
    26         adduser --system sipb-xen
    27 
     23        #Don't create users on upgrade
     24        if [ -z "$2" ]; then
     25            # Don't fail if the user/database already exists
     26            su postgres -c 'createuser sipb-xen -S -d -R'    || true
     27            su postgres -c 'createdb sipb_xen -O sipb-xen'   || true
     28            adduser --system sipb-xen
     29        fi
    2830        su sipb-xen -s /bin/sh -c 'sipb-xen-database-tables create'
    2931    ;;
Note: See TracChangeset for help on using the changeset viewer.