mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-28 03:37:49 +02:00
40 lines
1,015 B
Bash
Executable file
40 lines
1,015 B
Bash
Executable file
#!/bin/sh
|
|
set -e
|
|
|
|
LOGFILE='/var/log/dotnet/dotnet.log'
|
|
DOTNETHOME='/var/lib/dotnet'
|
|
DOTNETUSER='dotnet'
|
|
|
|
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 $DOTNETUSER > /dev/null 2>&1; then
|
|
groupadd -f $DOTNETUSER || true
|
|
usermod -s "/bin/false" -e 1 $DOTNETUSER > /dev/null || true
|
|
else
|
|
adduser --system --quiet --group --home $DOTNETHOME $DOTNETUSER
|
|
fi
|
|
|
|
mkdir -p -m0750 /var/log/dotnet
|
|
chown -f ${DOTNETUSER}:adm /var/log/dotnet
|
|
touch $LOGFILE
|
|
chmod 640 $LOGFILE
|
|
chown -f ${DOTNETUSER}:adm $LOGFILE
|
|
mkdir -p -m0750 $DOTNETHOME
|
|
chown -f -R -P ${DOTNETUSER}:${DOTNETUSER} ${DOTNETHOME}
|
|
;;
|
|
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
|