Changeset 7b49493


Ignore:
Timestamp:
Dec 26, 2011 6:43:28 PM (8 years ago)
Author:
kytv <kytv@…>
Branches:
master
Children:
daca27e
Parents:
848f309
Message:

Redo existing account handling

File:
1 edited

Legend:

Unmodified
Added
Removed
  • debian/i2p.postinst

    r848f309 r7b49493  
    6262        mv -f /etc/i2p/wrapper.config.tmp /etc/i2p/wrapper.config
    6363
    64     migrate_existing_user(){
    65         # Adjust the user/group in /etc/passwd, mainly for upgrades from old packages that didn't
    66         # create $I2PSYSUSER as a system group/user
    67         usermod -c "I2P Router Daemon" -m -d $I2PHOME -g $I2PSYSUSER -s "/bin/false" \
    68             -l $I2PSYSUSER -e 1 > /dev/null 2>&1
    69         echo "Existing user migrated, home directory moved to $I2PHOME"
    70     }
    71 
    7264    # Create user and group as a system user.
    73     adduser --system --quiet --group --home $I2PHOME $I2PSYSUSER || migrate_existing_user
     65    if getent passwd i2psvc > /dev/null 2>&1 ; then
     66        usermod -c "I2P Router Daemon" -d $I2PHOME -g $I2PSYSUSER -s "/bin/false" \
     67            $I2PSYSUSER -e 1 > /dev/null 2>&1
     68    else
     69        adduser --system --quiet --group --home $I2PHOME $I2PSYSUSER
     70    fi
    7471
    7572    [ -d /var/log/i2p ] || mkdir -m0750 /var/log/i2p
     
    9491                ;;
    9592esac
    96    
     93
    9794#DEBHELPER#
    9895
Note: See TracChangeset for help on using the changeset viewer.