- Created run-docker-tests.sh to execute setup tests in isolated Docker containers (Ubuntu and Debian). - Implemented logging functionality to track test results and errors. - Added startup.sh to ensure proper permissions and run tests within Docker containers. - Developed test-setup.sh to validate bootstrap.sh and setup.sh scripts, including package availability checks. - Enhanced error handling and reporting for package installations and missing dependencies. - Included detailed logging for system information and test results.
Shell Scripts and Dotfiles Repository
This repository contains various shell scripts for managing media-related tasks and dotfiles for system configuration.
Available Scripts
- Backup Media Script: Documentation for the
backup-media.shscript. plex.sh: Script to manage the Plex Media Server (start, stop, restart, status).backup-plex.sh: Script to back up Plex Media Server databases and related files.folder-metrics.sh: Script to calculate disk usage and file count for a directory and its subdirectories.
Documentation
- Plex Backup Script Documentation: Detailed documentation for the
backup-plex.shscript. - Plex Management Script Documentation: Detailed documentation for the
plex.shscript. - Folder Metrics Script Documentation: Detailed documentation for the
folder-metrics.shscript. - Testing Framework Documentation: Detailed documentation for the Docker-based testing system.
Dotfiles
The repository includes dotfiles for system configuration in the dotfiles directory. These can be automatically set up using the bootstrap script:
curl -fsSL https://raw.githubusercontent.com/acedanger/shell/main/bootstrap.sh | bash
For more information about the dotfiles, see Dotfiles README.
Testing
This repository includes Docker-based testing to validate the setup process across different environments:
- test-setup.sh: Script that validates the bootstrap and setup process
- run-docker-tests.sh: Runner script that executes tests in Docker containers
- Dockerfile: Defines test environments (Ubuntu, Debian)
Running Tests
Test your setup in isolated Docker containers with:
# Test in Ubuntu container
./run-docker-tests.sh ubuntu
# Test in Debian container
./run-docker-tests.sh debian
# Run full bootstrap test in Ubuntu
./run-docker-tests.sh full-ubuntu
# Run full bootstrap test in Debian
./run-docker-tests.sh full-debian
# Test in both Ubuntu and Debian
./run-docker-tests.sh all
When to Use Each Testing Option
-
Use
./run-docker-tests.sh ubuntuor./run-docker-tests.sh debianwhen you want to:- Quickly validate if packages in packages.list are available and installed
- Test if your test-setup.sh script is working correctly
- Check for issues with specific components without performing a full setup
-
Use
./run-docker-tests.sh full-ubuntuor./run-docker-tests.sh full-debianwhen you want to:- Test the complete bootstrap installation process end-to-end
- Validate that all installation steps work correctly on a fresh system
- Simulate what users will experience when running the bootstrap script
-
Use
./run-docker-tests.sh allwhen you want to:- Ensure your test-setup.sh works across both Ubuntu and Debian
- Run comprehensive checks before committing changes
The test environment checks:
- Package availability and installation
- Core components (git, curl, wget, etc.)
- Additional packages from
setup/packages.list - Oh My Zsh and plugin installation
- Dotfile symlinks
Tests will continue even when some packages fail to install, reporting all issues in a comprehensive summary.
plex.sh
This script is used to manage the Plex Media Server service on a systemd-based Linux distribution. It provides the following functionalities:
- start: Starts the Plex Media Server.
- stop: Stops the Plex Media Server.
- restart: Restarts the Plex Media Server.
- status: Displays the current status of the Plex Media Server.
Usage
Note that these commands will run as root.
./shell/plex.sh {start|stop|restart|status}