Browse Source

* update maintainer scripts

pull/308/head
hagen 9 years ago
parent
commit
632d26e398
  1. 10
      debian/postinst
  2. 2
      debian/postrm

10
debian/postinst vendored

@ -1,4 +1,5 @@
#!/bin/sh #!/bin/sh
set -e
I2PDHOME='/var/lib/i2pd' I2PDHOME='/var/lib/i2pd'
I2PDUSER='i2pd' I2PDUSER='i2pd'
@ -8,18 +9,17 @@ case "$1" in
# Older versions of adduser created the home directory. # Older versions of adduser created the home directory.
# The version of adduser in Debian unstable does not. # The version of adduser in Debian unstable does not.
# Create user and group as a system user. # Create user and group as a system user.
getent passwd ${I2PDUSER} > /dev/null 2>&1 if getent passwd $I2PDUSER > /dev/null 2>&1; then
if [ $? -eq 2 ]; then
adduser --system --quiet --group --home $I2PDHOME $I2PDUSER
else
groupadd -f $I2PDUSER || true groupadd -f $I2PDUSER || true
usermod -s "/bin/false" -e 1 $I2PDUSER > /dev/null || true usermod -s "/bin/false" -e 1 $I2PDUSER > /dev/null || true
else
adduser --system --quiet --group --home $I2PDHOME $I2PDUSER
fi fi
touch /var/log/i2pd.log touch /var/log/i2pd.log
chown -f ${I2PDUSER}:adm /var/log/i2pd.log chown -f ${I2PDUSER}:adm /var/log/i2pd.log
mkdir -p -m0750 $I2PDHOME mkdir -p -m0750 $I2PDHOME
chown -f -R ${I2PDUSER}:${I2PDUSER} ${I2PDHOME} chown -f -R -P ${I2PDUSER}:${I2PDUSER} ${I2PDHOME}
;; ;;
abort-upgrade|abort-remove|abort-deconfigure) abort-upgrade|abort-remove|abort-deconfigure)
echo "Aborting upgrade" echo "Aborting upgrade"

2
debian/postrm vendored

@ -1,9 +1,9 @@
#!/bin/sh #!/bin/sh
set -e set -e
if [ "$1" = "purge" ]; then if [ "$1" = "purge" ]; then
rm -f /etc/default/i2pd /var/log/i2pd.log rm -f /etc/default/i2pd /var/log/i2pd.log
rm -rf /etc/i2pd
rm -rf /var/lib/i2pd rm -rf /var/lib/i2pd
fi fi

Loading…
Cancel
Save