diff --git a/runtipi/README.md b/runtipi/README.md new file mode 100644 index 0000000..1a75c4d --- /dev/null +++ b/runtipi/README.md @@ -0,0 +1,11 @@ +# Install Ubuntu + +```bash +bash -c "$(wget -qLO - https://github.com/tteck/Proxmox/raw/main/ct/ubuntu.sh)" +``` + +# Install RunTipi + +```bash +bash -c "$(wget -qLO - https://raw.githubusercontent.com/bigbeartechworld/big-bear-scripts/master/runtipi/install.sh)" +``` diff --git a/runtipi/install.sh b/runtipi/install.sh new file mode 100644 index 0000000..b30d910 --- /dev/null +++ b/runtipi/install.sh @@ -0,0 +1,102 @@ +#!/bin/bash + +echo "This script installs a new Runtipi instance on a fresh Ubuntu server." +echo "This script does not ensure system security." +echo "" + +# Get the IP address +CURRENT_IP=$(hostname -I | awk '{print $1}') + +# Define Runtipi installation path +RUNTIPI_PATH="/root/runtipi" + +# Generate a path for a log file to output into for debugging +LOGPATH=$(realpath "runtipi_install_$(date +%s).log") + +# Install dependencies +function run_install_dependencies() { + sudo apt-get update + sudo apt-get install -y curl || error_out "Failed to install dependencies." +} + +# Install Runtipi +function run_install_runtipi() { + # Download the script first + curl -L -o runtipi_install.sh https://setup.runtipi.io + # Execute the script + bash runtipi_install.sh || error_out "Failed to install Runtipi." +} + +# Create the systemd service file +function run_create_service_file() { + cat <&2 + exit 1 +} + +# Echo out an information message to both the command line and log file +function info_msg() { + echo "$1" | tee -a "$LOGPATH" +} + +info_msg "1/7 Installing dependencies..." +run_install_dependencies >> "$LOGPATH" 2>&1 + +info_msg "[2/7] Installing Runtipi... (This may take several minutes)" +run_install_runtipi >> "$LOGPATH" 2>&1 + +info_msg "[3/7] Creating the systemd service file..." +run_create_service_file >> "$LOGPATH" 2>&1 + +info_msg "[4/7] Reloading the systemd daemon..." +run_reload_systemd >> "$LOGPATH" 2>&1 + +info_msg "[5/7] Enabling the tipi service..." +run_enable_service >> "$LOGPATH" 2>&1 + +info_msg "[6/7] Displaying the status of the tipi service..." +run_status_service >> "$LOGPATH" 2>&1 + +info_msg "[7/7] Done!" + +info_msg "----------------------------------------------------------------" +info_msg "Setup finished, your Runtipi instance should now be installed!" +info_msg "- Access URL: http://$CURRENT_IP/" +info_msg "- Runtipi install path: $RUNTIPI_PATH" +info_msg "- Install script log: $LOGPATH" +info_msg "---------------------------------------------------------------"