#!/bin/bash # Ensure the script stops executing if an error occurs set -e # Update the system's package list echo "Updating system package list..." sudo apt update # Install necessary tools echo "Installing gnupg and curl..." sudo apt install -y gnupg curl # Add GPG key to the system echo "Adding GPG key..." curl https://source.moyanjdc.top/deb/gpg.key | sudo gpg --dearmor -o /usr/share/keyrings/moyan.gpg # Add the repository to the system's sources.list.d directory echo "Adding repository..." mkdir -p /etc/apt/sources.list.d echo "deb [signed-by=/usr/share/keyrings/moyan.gpg] https://source.moyanjdc.top/deb/ debs main" | sudo tee /etc/apt/sources.list.d/moyan.list # Update the package list to include the newly added repository echo "Updating package list..." sudo apt update # Print completion message echo "Third-party repository added successfully."