#!/bin/bash # # Purpose : The end of install.sh: say the install worked, say whether to # reboot, and offer configure if something is still to do. refresh # runs install.sh too, so it may all be done already; the install # still ends by saying it worked, so it can't be taken for a failure. # install.sh is usually piped into bash, so ask on the terminal TTY="${COREDESKTOP_TTY:-/dev/tty}" CONFIGURE="$HOME/.local/bin/configure" CONFIGURE_HINT="configure connects to your Federated Core, sets up backups and signs you in to the AI agents." echo echo -e "\e[32mCoreDesktop is installed.\e[0m" # If the running kernel's modules are gone, a newer kernel was installed during # this run. configure waits for the reboot: until then, modules it needs, such # as Tailscale's tun and davfs2's fuse, can't be loaded. if [ ! -d "/usr/lib/modules/$(uname -r)" ]; then echo "A newer kernel has been installed. Reboot, then run: configure" echo "$CONFIGURE_HINT" exit 0 fi echo "Kernel is up to date, no reboot needed. You may want to consider a reboot if other significant software was updated or installed." if "$CONFIGURE" --list | grep -q '^to do'; then echo echo "$CONFIGURE_HINT" if { : < "$TTY"; } 2> /dev/null && read -rp "Run configure now? [Y/n] " answer < "$TTY" \ && [[ "$answer" != [nN]* ]]; then # Straight to the terminal, outside the log: sign-ins need a terminal, and # their codes and links don't belong in a log "$CONFIGURE" < "$TTY" > "$TTY" 2>&1 || true else echo "To do it later, run: configure" fi fi