From 0bf50b0defa04df8f04a01205692ee4638442fb6 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Wed, 9 May 2018 02:34:02 +0200 Subject: [PATCH] Have a nice message about running the postinstall when logging in ssh if yunohost aint installed --- stage3/00-install-yunohost/00-run.sh | 2 ++ .../files/check_yunohost_is_installed.sh | 28 +++++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 stage3/00-install-yunohost/files/check_yunohost_is_installed.sh diff --git a/stage3/00-install-yunohost/00-run.sh b/stage3/00-install-yunohost/00-run.sh index 2704081..a731014 100755 --- a/stage3/00-install-yunohost/00-run.sh +++ b/stage3/00-install-yunohost/00-run.sh @@ -17,6 +17,8 @@ echo "root:yunohost" | chpasswd chage -d 0 root EOF +install -m 755 files/check_yunohost_is_installed.sh "${ROOTFS_DIR}/etc/profile.d/" + echo "Cleaning ..." on_chroot << EOF apt-get clean diff --git a/stage3/00-install-yunohost/files/check_yunohost_is_installed.sh b/stage3/00-install-yunohost/files/check_yunohost_is_installed.sh new file mode 100644 index 0000000..45cdf00 --- /dev/null +++ b/stage3/00-install-yunohost/files/check_yunohost_is_installed.sh @@ -0,0 +1,28 @@ +#!/bin/sh + +if [ -n "$BASH_VERSION" ] && [ "$-" != "${-#*i}" ]; then + if [ ! -f "/etc/yunohost/installed" ]; + then + normal=$(printf '\033[0m') + bold=$(printf '\033[1m') + blue=$(printf '\033[34m') + + IPS=$(hostname --all-ip-address | sed 's/ /\n /g') + cat << EOF +====================================================================== +${bold}${blue} + Congratulations on setting up your YunoHost server ! +${normal}${bold} + To finish the installation, you should run the postinstallation. + You can find documentation about it on :${normal} + https://yunohost.org/postinstall +${normal}${bold} + You can run it from the command line interface with :${normal} + $ yunohost tools postinstall +${normal}${bold} + Or from a browser by accessing one of your local IP :${normal} + $IPS${normal} +====================================================================== +EOF + fi +fi