forked from PurpleI2P/i2pd
-
Notifications
You must be signed in to change notification settings - Fork 0
/
postinst
executable file
·40 lines (35 loc) · 977 Bytes
/
postinst
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/bin/sh
set -e
LOGFILE='/var/log/i2pd/i2pd.log'
I2PDHOME='/var/lib/i2pd'
I2PDUSER='i2pd'
case "$1" in
configure|reconfigure)
# Older versions of adduser created the home directory.
# The version of adduser in Debian unstable does not.
# Create user and group as a system user.
if getent passwd $I2PDUSER > /dev/null 2>&1; then
groupadd -f $I2PDUSER || true
usermod -s "/bin/false" -e 1 $I2PDUSER > /dev/null || true
else
adduser --system --quiet --group --home $I2PDHOME $I2PDUSER
fi
mkdir -p -m0750 /var/log/i2pd
chown -f ${I2PDUSER}:adm /var/log/i2pd
touch $LOGFILE
chmod 640 $LOGFILE
chown -f ${I2PDUSER}:adm $LOGFILE
mkdir -p -m0750 $I2PDHOME
chown -f -R -P ${I2PDUSER}:${I2PDUSER} ${I2PDHOME}
;;
abort-upgrade|abort-remove|abort-deconfigure)
echo "Aborting upgrade"
exit 0
;;
*)
echo "postinst called with unknown argument '$1'" >&2
exit 0
;;
esac
#DEBHELPER#
exit 0