From c0be9676e37c9a6b13c48070b29897e1efefc1a7 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Mon, 21 May 2018 00:46:48 +0200 Subject: [PATCH] Rework condition (and remove the 'from_script' flag) --- bin/yunoprompt | 47 ++++++++++++++++++++++------------------------- 1 file changed, 22 insertions(+), 25 deletions(-) diff --git a/bin/yunoprompt b/bin/yunoprompt index 5a7992789..b92f2d209 100755 --- a/bin/yunoprompt +++ b/bin/yunoprompt @@ -47,31 +47,28 @@ $LOGO EOF ) -if [[ ! -f /etc/yunohost/installed ]] +if [[ -f /etc/yunohost/installed ]] then - if [[ ! -f /etc/yunohost/from_script ]] - then - sleep 5 - chvt 2 - echo "$LOGO_AND_FINGERPRINTS" - echo -e "\e[m Post-installation \e[0m" - echo "Congratulations! YunoHost has been successfully installed.\nTwo more steps are required to activate the services of your server." - read -p "Proceed to post-installation? (y/n) " -n 1 - RESULT=1 - while [ $RESULT -gt 0 ]; do - if [[ $REPLY =~ ^[Nn]$ ]]; then - chvt 1 - exit 0 - fi - echo -e "\n" - /usr/bin/yunohost tools postinstall - let RESULT=$? - if [ $RESULT -gt 0 ]; then - echo -e "\n" - read -p "Retry? (y/n) " -n 1 - fi - done - fi -else # YunoHost is already post-installed echo "$LOGO_AND_FINGERPRINTS" > /etc/issue +else + sleep 5 + chvt 2 + echo "$LOGO_AND_FINGERPRINTS" + echo -e "\e[m Post-installation \e[0m" + echo "Congratulations! YunoHost has been successfully installed.\nTwo more steps are required to activate the services of your server." + read -p "Proceed to post-installation? (y/n) " -n 1 + RESULT=1 + while [ $RESULT -gt 0 ]; do + if [[ $REPLY =~ ^[Nn]$ ]]; then + chvt 1 + exit 0 + fi + echo -e "\n" + /usr/bin/yunohost tools postinstall + let RESULT=$? + if [ $RESULT -gt 0 ]; then + echo -e "\n" + read -p "Retry? (y/n) " -n 1 + fi + done fi