#!/bin/bash

# Wrapped in { ...; exit; } so bash reads the whole script up front; install.sh
# replaces this file while it runs.
{

# Print the logo
print_logo() {
  cat << "EOF"

 ███╗   ███╗██╗███╗   ██╗██╗
 ████╗ ████║██║████╗  ██║██║
 ██╔████╔██║██║██╔██╗ ██║██║
 ██║╚██╔╝██║██║██║╚██╗██║██║
 ██║ ╚═╝ ██║██║██║ ╚████║██║
 ╚═╝     ╚═╝╚═╝╚═╝  ╚═══╝╚═╝

 ███████╗███████╗██████╗ ██╗   ██╗███████╗██████╗
 ██╔════╝██╔════╝██╔══██╗██║   ██║██╔════╝██╔══██╗
 ███████╗█████╗  ██████╔╝██║   ██║█████╗  ██████╔╝
 ╚════██║██╔══╝  ██╔══██╗╚██╗ ██╔╝██╔══╝  ██╔══██╗
 ███████║███████╗██║  ██║ ╚████╔╝ ███████╗██║  ██║
 ╚══════╝╚══════╝╚═╝  ╚═╝  ╚═══╝  ╚══════╝╚═╝  ╚═╝



EOF
}

# Clear screen and show logo
clear
print_logo

echo "Let's get the latest changes to MiniServer..."

if [ -f "$HOME/.local/share/MiniServer/install.sh" ]; then
  bash "$HOME/.local/share/MiniServer/install.sh"
else
  wget -qO- https://gitea.young.computer/david/MiniServer/raw/branch/main/install.sh | bash
fi
exit
}
