2017-06-17 01:26:56 -07:00
|
|
|
#!/bin/sh
|
2018-03-02 17:36:37 -08:00
|
|
|
# preinst script for basecoind
|
2017-06-17 01:26:56 -07:00
|
|
|
#
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
# summary of how this script can be called:
|
|
|
|
# * <new-preinst> `install'
|
|
|
|
# * <new-preinst> `install' <old-version>
|
|
|
|
# * <new-preinst> `upgrade' <old-version>
|
|
|
|
# * <old-preinst> `abort-upgrade' <new-version>
|
|
|
|
# for details, see https://www.debian.org/doc/debian-policy/ or
|
|
|
|
# the debian-policy package
|
|
|
|
|
|
|
|
|
|
|
|
case "$1" in
|
|
|
|
install|upgrade)
|
2018-03-02 17:36:37 -08:00
|
|
|
if ! grep -q '^basecoind:' /etc/passwd ; then
|
|
|
|
useradd -k /dev/null -r -m -b /etc basecoind
|
|
|
|
chmod 755 /etc/basecoind
|
2017-06-17 01:26:56 -07:00
|
|
|
fi
|
|
|
|
;;
|
|
|
|
|
|
|
|
abort-upgrade)
|
|
|
|
;;
|
|
|
|
|
|
|
|
*)
|
|
|
|
echo "preinst called with unknown argument \`$1'" >&2
|
|
|
|
exit 1
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
# dh_installdeb will replace this with shell code automatically
|
|
|
|
# generated by other debhelper scripts.
|
|
|
|
|
|
|
|
#DEBHELPER#
|
|
|
|
|
|
|
|
exit 0
|