Files
dokku/debian/preinst
Jeroen van Baarsen 2a4155aefc Add skip_keyfile option for deb package
There are cases where we don't want the check for keyfile, this will add a
config option, that allows you to skip this particular check.

Fixes #1851

Signed-off-by: Jeroen van Baarsen <jeroenvanbaarsen@gmail.com>
2016-01-12 17:11:13 +01:00

55 lines
1.2 KiB
Bash
Executable File

#!/bin/bash
set -eo pipefail; [[ $TRACE ]] && set -x
. /usr/share/debconf/confmodule
case "$1" in
install)
db_get "dokku/web_config"
if [ "$RET" = "true" ]; then
NGINX_CONF="/etc/nginx/conf.d/dokku-installer.conf"
rm -f $NGINX_CONF
touch $NGINX_CONF
{
echo 'upstream dokku-installer { server 127.0.0.1:2000; }'
echo 'server {'
echo ' listen 80;'
echo ' location / {'
echo ' proxy_pass http://dokku-installer;'
echo ' }'
echo '}'
} >> $NGINX_CONF
rm -f /etc/nginx/sites-enabled/*
service nginx reload || /etc/init.d/nginx reload
exit 0
fi
db_get "dokku/skip_key_file"
if [ -z "${DEBCONF_RECONFIGURE}" ] && [ "$RET" != "true" ]; then
db_get "dokku/key_file"
if [ ! -f "$RET" ]; then
echo "Error: keyfile '$RET' not found."
echo " you can enter a new keyfile path when you restart the installation."
db_reset "dokku/key_file"
exit 1
fi
fi
;;
upgrade)
;;
abort-upgrade)
;;
*)
echo "preinst called with unknown argument \`$1'" >&2
exit 1
;;
esac
exit 0