Master Control Program Script Documentation
Overview
This Bash script is a terminal-based, interactive menu system designed to manage and execute various commonly used commands for different tasks. It organizes the user’s most frequently used functions into categories, providing a central control interface. The script offers a way to access applications, system administration tasks, remote server management, hacking tools, and other specialized commands in an easy-to-navigate menu.
Structure
The script defines multiple functions that correspond to different categories of tasks. Each function displays a menu of options, waits for user input, and then executes the corresponding action based on the user’s selection. The script uses a combination of standard shell commands, external utilities (like yt-dlp
, nmap
, mc
, etc.), and some custom functions.
The script is organized into the following categories:
- Applications
- Servers
- System Administration
- Get Stuff
- Hacking
- BSD Games
- AI
- Hidden (for secret tasks)
At the core, the script uses a function called mcp()
that acts as the main control menu to navigate to any of the subcategories.
Functions
title()
- Displays a simple ASCII art title with the text “MASTER CONTROL PROGRAM” and the current hostname.
- Purpose: To provide a visual header for the menu screens.
mcp()
- The main control function, responsible for displaying the primary menu.
- This function gives the user options to navigate to different submenus like applications, servers, system administration, etc.
- It uses a
while
loop to repeatedly prompt the user for their selection until they choose to exit.
applications()
- A submenu for managing applications.
- Options include launching a web browser (
lynx
), checking the weather, managing music withcmus
, creating QR codes, and more. - Utilizes commands like
curl
,newsboat
, andqrencode
to perform various tasks.
servers()
- A submenu for managing remote servers via SSH.
- Provides options to connect to different servers like Plex Media Server, Nextcloud, NAS, VPS, Pi-Hole, and more.
- Each selection runs an SSH command to connect to the specified server.
getstuff()
- A submenu for downloading files and media from various sources.
- Includes options to download YouTube videos, music, images, and even entire websites using tools like
yt-dlp
,wget
, andhttrack
. - Offers specific functionality for managing Plex Media, including sending YouTube videos to Plex and administering the media library.
hacking()
- A submenu with tools for penetration testing and hacking.
- Options include network scanning with
nmap
, running Nikto web vulnerability scans, performing Whois lookups, and connecting via SSH. - Some actions involve using custom scripts like
multimon-ng
for POCSAG and FLEX radio decoding.
sysadmin()
- A submenu for system administration tasks.
- Includes operations like clearing temp files, mapping remote directories, installing updates, managing cron jobs, viewing GPU info, and more.
- Several options involve file downloads (
wget
), updating software, and managing system configurations.
bsdgames()
- A submenu for playing classic BSD terminal games like
adventure
,backgammon
,tetris
,hangman
, and more. - Offers a selection of 40 different games, all accessible via command-line.
ai()
- A submenu for interacting with AI tools.
- Provides access to local and cloud-based AI models (like Ollama) for tasks such as coding assistance and general inquiry.
- Users can interact with AI models like
llama2-uncensored
,codellama
, andmistral:latest
.
hidden()
- A “secret” menu that contains hidden functions.
- Options include opening a secret text file (
nano
), or sending the MCP script to the~/bin/
directory for easier access. - This submenu is less visible and can be used to perform actions that are not intended to be seen by others.
Flow Control
- The script uses
while
loops to continuously prompt the user for input until they select the exit option (99
). - Each submenu is a separate function, and the user can always return to the main menu (
mcp
) by choosing99
. - Some tasks require user input, such as URLs, filenames, or credentials, while others use default or hardcoded values.
Error Handling
- The script does not appear to include extensive error handling or input validation, so it assumes that the user provides valid input.
- Some commands may fail if certain tools are not installed or if network connectivity is unavailable (e.g., SSH,
yt-dlp
, etc.).
Example Use Cases
- Launching applications: Use the “Applications” menu to quickly open a web browser or play music with
cmus
. - Server management: SSH into a remote server by selecting the corresponding option in the “Servers” menu.
- Penetration testing: Run network scans or vulnerability assessments using tools like
nmap
andnikto
in the “Hacking” menu. - Downloading media: Fetch videos, music, or even entire websites from the internet using the “Get Stuff” submenu.
Installation Instructions
- Ensure you have all the necessary utilities installed, including:
lynx
,curl
,yt-dlp
,mc
,nmap
,neomutt
,crontab
,qrencode
, and others.
- Save the script to a file, e.g.,
mcp.sh
. - Make the script executable:
chmod +x mcp.sh
- Execute the script by running:
./mcp.sh
Conclusion
This script offers a powerful, customizable terminal interface for managing a variety of tasks, from system administration and server management to media downloads and hacking tools. By providing easy access to frequently used commands, it helps streamline workflows and reduce the need to remember long command sequences.
Download mcp.zip