mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
Fix several issues with bootprompt
This commit is contained in:
parent
6a7990d7fb
commit
bbfa9fc124
1 changed files with 33 additions and 10 deletions
|
@ -1,8 +1,5 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Fetch ips
|
||||
ip=$(hostname --all-ip-address)
|
||||
|
||||
# Fetch SSH fingerprints
|
||||
i=0
|
||||
for key in $(ls /etc/ssh/ssh_host_{ed25519,rsa,ecdsa}_key.pub 2> /dev/null) ; do
|
||||
|
@ -32,11 +29,17 @@ EOF
|
|||
# Build the actual message
|
||||
#
|
||||
|
||||
sleep 5
|
||||
# Get local IP
|
||||
# (we do this after the sleep 5 to have
|
||||
# better chances that the network is up)
|
||||
local_ip=$(hostname --all-ip-address | awk '{print $1}')
|
||||
|
||||
LOGO_AND_FINGERPRINTS=$(cat << EOF
|
||||
|
||||
$LOGO
|
||||
|
||||
IP: ${ip}
|
||||
IP: ${local_ip}
|
||||
SSH fingerprints:
|
||||
${fingerprint[0]}
|
||||
${fingerprint[1]}
|
||||
|
@ -51,17 +54,35 @@ if [[ -f /etc/yunohost/installed ]]
|
|||
then
|
||||
echo "$LOGO_AND_FINGERPRINTS" > /etc/issue
|
||||
else
|
||||
sleep 5
|
||||
chvt 2
|
||||
|
||||
# Formatting
|
||||
[[ -n "$local_ip" ]] && local_ip=$(echo -e "https://$local_ip/") || local_ip="(no ip detected?)"
|
||||
|
||||
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)\nAlternatively, you can proceed the post-installation on https://${ip}" -n 1
|
||||
cat << EOF
|
||||
===============================================================================
|
||||
You should now proceed with Yunohost post-installation. This is where you will
|
||||
be asked for :
|
||||
- the main domain of your server ;
|
||||
- the administration password.
|
||||
|
||||
You can perform this step :
|
||||
- from your web browser, by accessing : ${local_ip}
|
||||
- or in this terminal by answering 'yes' to the following question
|
||||
|
||||
If this is your first time with YunoHost, it is strongly recommended to take
|
||||
time to read the administator documentation and in particular the sections
|
||||
'Finalizing your setup' and 'Getting to know YunoHost'. It is available at
|
||||
the following URL : https://yunohost.org/admindoc
|
||||
===============================================================================
|
||||
EOF
|
||||
|
||||
read -p "Proceed with post-installation? (y/n) "
|
||||
RESULT=1
|
||||
while [ $RESULT -gt 0 ]; do
|
||||
if [[ $REPLY =~ ^[Nn]$ ]]; then
|
||||
chvt 1
|
||||
exit 0
|
||||
break
|
||||
fi
|
||||
echo -e "\n"
|
||||
/usr/bin/yunohost tools postinstall
|
||||
|
@ -71,4 +92,6 @@ else
|
|||
read -p "Retry? (y/n) " -n 1
|
||||
fi
|
||||
done
|
||||
chvt 1
|
||||
exit 0
|
||||
fi
|
||||
|
|
Loading…
Add table
Reference in a new issue