https://bugs.contribs.org/show_bug.cgi?id=8685

--- Comment #22 from John Crisp <[email protected]> ---
OK, so definitely need to backup the old certs and install fresh so we get
updated encryption all round.

I am trying to add a check in the %prein to say 'do you want to continue or
not' but I can't get it to work and I have no idea why.

Something like this:

%pre
echo "This contrib now has higher levels of encryption"
echo "You should really backup your old certificates"
echo "and start with a new CA"
echo "If you want to start again then press y to continue"
echo "We will backup your old certificates and you can then start again"
echo ""
echo "If not press any other key to exit the install"

read -r -p "Are you sure? [y/N] " response
response=${response,,}    # tolower
if ! [[ "$response" =~ ^(yes|y)$ ]]; then
  echo "No pressed. Exiting"
  echo "Backup your /opt/phpki/phpki-store before trying again"
  echo "mv /opt/phpki/phpki-store /opt/phpki/phpki-store.old"
  exit
fi

echo "Continuing"
echo "backing up old certificates to /opt/phpki/phpki-store.old"
mv /opt/phpki/phpki-store /opt/phpki/phpki-store.old
echo "Creating phpki users"

if ! /usr/bin/id phpki &>/dev/null; then
        /usr/sbin/useradd -c 'Phpki User' -s /sbin/nologin -r -d
/opt/phpki/phpki-store phpki &>/dev/null || \
                %logmsg "Unexpected error adding user \"phpki\". Abort
installation."
fi

I can't see any way to do this so any suggestions appreciated

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
_______________________________________________
Mail for each SME Contribs bug report
To unsubscribe, e-mail [email protected]
Searchable archive at https://lists.contribs.org/mailman/public/contribteam/

Reply via email to