File: /var/lib/dpkg/info/bitninja.preinst
#!/bin/sh
# preinst script for bitninja
#
# see: dh_installdeb(1)
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 http://www.debian.org/doc/debian-policy/ or
# the debian-policy package
case "$1" in
install)
DEFVALUE="bitninja";
MYVALUE="$(getent passwd $DEFVALUE | grep -vE '(nologin|false)$' | awk -F: -v min=`awk '/^UID_MIN/ {print $2}' /etc/login.defs` -v max=`awk '/^UID_MAX/ {print $2}' /etc/login.defs` '{if(($3 >= min)&&($3 <= max)) print $1}')";
if [ "$MYVALUE" = "$DEFVALUE" ]; then
echo "-----------------------------------------------------------------------";
echo "User 'bitninja' already exists, cannot install.";
echo "-----------------------------------------------------------------------";
exit 1;
fi
echo "-----------------------------------------------------------------------";
echo " ";
echo " In case you chose not to use the universal installer ";
echo " please insert your license key by using the following command as root:";
echo " ";
echo " bitninja-config --set license_key=<your_license_key_here>";
echo " ";
echo " Please find your license key at https://admin.bitninja.io";
echo " at the Settings/General menu.";
echo " ";
echo "-----------------------------------------------------------------------";
;;
upgrade)
;;
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