postinst is in sftpcloudfs 0.12.2-1.
This file is a maintainer script. It is executed when installing (*inst) or removing (*rm) the package.
The actual contents of the file can be viewed below.
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 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 | #!/bin/sh
set -e
if [ "${1}" = "configure" ] ; then
if ! getent group sftpcloudfs > /dev/null 2>&1 ; then
addgroup --system sftpcloudfs >/dev/null
fi
if ! getent passwd sftpcloudfs > /dev/null 2>&1 ; then
adduser --system --home /var/log/sftpcloudfs --ingroup sftpcloudfs --no-create-home --shell /bin/false sftpcloudfs > /dev/null 2>&1
fi
# RAS key file directory
if [ ! -e /etc/sftpcloudfs ] ; then
mkdir -m 0700 -p /etc/sftpcloudfs
fi
if [ ! -e /etc/sftpcloudfs/sftpcloudfs.key ] ; then
ssh-keygen -f /etc/sftpcloudfs/sftpcloudfs.key -N '' -C ''
fi
if [ ! -e /etc/sftpcloudfs/sftpcloudfs.conf ] ; then
install -D -m 0640 -g sftpcloudfs -o sftpcloudfs /usr/share/sftpcloudfs/sftpcloudfs.conf /etc/sftpcloudfs/sftpcloudfs.conf
MY_GID=`id -g sftpcloudfs`
MY_UID=`id -u sftpcloudfs`
sed -i -e "s#^[ \t]*uid[ \t]*=.*#uid = ${MY_UID}#" /etc/sftpcloudfs/sftpcloudfs.conf
sed -i -e "s#^[ \t]*gid[ \t]*=.*#gid = ${MY_GID}#" /etc/sftpcloudfs/sftpcloudfs.conf
fi
chown -R sftpcloudfs:sftpcloudfs /etc/sftpcloudfs
# log directory
mkdir -m 0700 -p /var/log/sftpcloudfs
touch /var/log/sftpcloudfs/sftpcloudfs.log
chmod 0640 /var/log/sftpcloudfs/sftpcloudfs.log
chown -R sftpcloudfs:sftpcloudfs /var/log/sftpcloudfs
# pid file directory
mkdir -m 0700 -p /var/run/sftpcloudfs
chown -R sftpcloudfs:sftpcloudfs /var/run/sftpcloudfs
# Debconf for the auth-url
. /usr/share/debconf/confmodule
db_get sftpcloudfs/auth-url
if [ -n "${RET}" ] ; then
sed -i -e "s#^[ \t]*auth-url[ \t]*=.*#auth-url = ${RET}#" /etc/sftpcloudfs/sftpcloudfs.conf
fi
db_stop
fi
# Automatically added by dh_python2:
if which pycompile >/dev/null 2>&1; then
pycompile -p sftpcloudfs
fi
# End automatically added section
# Automatically added by dh_installinit
if [ -x "/etc/init.d/sftpcloudfs" ] || [ -e "/etc/init/sftpcloudfs.conf" ]; then
if [ ! -e "/etc/init/sftpcloudfs.conf" ]; then
update-rc.d sftpcloudfs defaults >/dev/null
fi
invoke-rc.d sftpcloudfs start || true
fi
# End automatically added section
exit 0
|