Add README.md
This commit is contained in:
commit
c0c753a572
1 changed files with 130 additions and 0 deletions
130
README.md
Normal file
130
README.md
Normal file
|
@ -0,0 +1,130 @@
|
|||
# CloudPanel Script Management
|
||||
|
||||
This repository contains the `master.sh` script, designed to simplify the execution of CloudPanel management and automation scripts. The `master.sh` script automatically fetches a list of available scripts from the repository, allows you to select and run them, and handles dependencies and cleanup. This guide explains how to use the `master.sh` script to manage your CloudPanel server efficiently.
|
||||
|
||||
The goal of this repo is to make it as simple as possible to run maintenance and automation scripts for CloudPanel servers directly from our GitHub repository.
|
||||
|
||||
|
||||
## Table of Contents
|
||||
|
||||
- [Demo](#demo)
|
||||
- [Usage](#usage)
|
||||
- [Features](#features)
|
||||
- [Dependencies](#dependencies)
|
||||
- [Error Handling](#error-handling)
|
||||
- [Cleanup](#cleanup)
|
||||
- [Contributing](#contributing)
|
||||
- [License](#license)
|
||||
|
||||
## Demo
|
||||
|
||||
```bash
|
||||
wget https://git.hhf.technology/hhf/script-management-cloudpanel/main/master.sh -O master.sh && bash master.sh
|
||||
```
|
||||
|
||||
Select any CloudPanel management script, such as `backup/mysql-backup.sh` or `security/ssl-renewal.sh`
|
||||
|
||||
<details>
|
||||
<summary>Script Selection Example</summary>
|
||||
|
||||
[Your script selection screenshot here]
|
||||
|
||||
</details>
|
||||
|
||||
## Usage
|
||||
|
||||
To use the `master.sh` script on your CloudPanel server, run the following command:
|
||||
|
||||
```bash
|
||||
wget https://git.hhf.technology/hhf/script-management-cloudpanel/main/master.sh -O master.sh && bash master.sh
|
||||
```
|
||||
|
||||
|
||||
### Running with Verbose Output
|
||||
|
||||
For detailed execution logs, especially useful when troubleshooting CloudPanel-related scripts:
|
||||
|
||||
```bash
|
||||
bash master.sh -v
|
||||
```
|
||||
|
||||
### Selecting and Running Scripts
|
||||
|
||||
1. Fetch List of Scripts: The script automatically fetches the list of available CloudPanel management scripts from this repository.
|
||||
2. Select a Script: Choose from various categories like backups, security, maintenance, or site management.
|
||||
3. Run the Script: The selected script is downloaded, executed, and cleaned up after execution.
|
||||
|
||||
## Features
|
||||
|
||||
- Automatic Dependency Installation: Ensures that required tools like sudo, curl, and jq are installed before proceeding.
|
||||
- CloudPanel Compatibility Check: Verifies that scripts are running on a CloudPanel installation.
|
||||
- Script Categories:
|
||||
- Backup Management
|
||||
- SSL Certificate Management
|
||||
- Site Deployment
|
||||
- Database Management
|
||||
- Security Updates
|
||||
- Performance Optimization
|
||||
- Verbose Mode: Use the `-v` flag to enable detailed logging during script execution.
|
||||
- Error Handling: Built-in error handling ensures that scripts exit gracefully and provide informative error messages.
|
||||
- Cleanup: Automatically removes temporary files and the script itself after execution.
|
||||
|
||||
## Dependencies
|
||||
|
||||
The `master.sh` script relies on the following tools:
|
||||
|
||||
- `sudo`: Ensures elevated permissions for installing packages and running scripts
|
||||
- `curl`: Used to fetch the list of scripts and download individual scripts
|
||||
- `jq`: Parses JSON responses from GitHub API
|
||||
|
||||
|
||||
If any of these tools are not installed, the script will attempt to install them automatically.
|
||||
|
||||
## Error Handling
|
||||
|
||||
The script includes robust error handling mechanisms:
|
||||
|
||||
- Command Failures: Handles network issues, missing dependencies, and CloudPanel-specific errors
|
||||
- Invalid Script Selection: Prompts for retry on invalid selections
|
||||
- CloudPanel State Verification: Checks CloudPanel service status before executing critical scripts
|
||||
- HTTP Status Codes: Provides feedback if script downloads fail
|
||||
|
||||
## Cleanup
|
||||
|
||||
After running the selected script(s), the master.sh script performs the following cleanup actions:
|
||||
|
||||
- Temporary Files: Removes any temporary files created during script execution
|
||||
- Log Rotation: Manages CloudPanel-related log files
|
||||
- Self-Removal: Deletes the `master.sh` script itself
|
||||
- These actions ensure that your CloudPanel server remains clean after script execution
|
||||
|
||||
## Contributing
|
||||
|
||||
We welcome contributions to enhance CloudPanel automation! To contribute:
|
||||
|
||||
1. Fork the repository
|
||||
2. Create a new branch with your feature or bugfix
|
||||
3. Submit a pull request for review
|
||||
|
||||
### Adding New Scripts
|
||||
|
||||
To add a new CloudPanel management script:
|
||||
|
||||
1. Create your script in the appropriate category folder (e.g., `backup/`, `security/`, `maintenance/`)
|
||||
2. Ensure the script follows CloudPanel best practices and includes proper error handling
|
||||
3. Make the script executable (`chmod +x script_name.sh`)
|
||||
4. Add appropriate documentation and usage examples
|
||||
5. Submit a pull request
|
||||
|
||||
### Script Categories
|
||||
|
||||
- `backup/`: Backup and restore scripts
|
||||
- `security/`: Security-related scripts (SSL, firewall, etc.)
|
||||
- `maintenance/`: Server maintenance scripts
|
||||
- `sites/`: Website management scripts
|
||||
- `database/`: Database management scripts
|
||||
- `monitoring/`: Server monitoring scripts
|
||||
|
||||
## License
|
||||
|
||||
This repository is licensed under the MIT License. See the LICENSE file for more details.
|
Loading…
Reference in a new issue