A collection of useful scripts for various Linux distributions
Category | Script | Type | Supports |
---|---|---|---|
Asset Tracking | Collect Asset Inventory (SuiteCRM) | Python | |
Asset Tracking | Collect Asset Inventory (SuiteCRM) | Powershell | |
Game Server | Install ARK Survival Ascended Dedicated Server | Shell | |
Game Server | Install Project Zomboid | Shell | |
Hardware | Disk Drive Health Check | Shell | |
Security | Firewall - Check Status | Shell | |
Security | Install Firewall (UFW) | Shell | |
System Monitoring | Install Zabbix Agent2 | Shell | |
System Monitoring | Install Zabbix Proxy | Shell | |
User Management | Authorize SSH key for a user | Python | |
User Management | Firewall - Whitelist IP | Shell | |
Uncategorized | src/test-firewall/test.sh | Shell |
Will compile each script into a single distributable file with all dependencies included within.
python3 compile.py
Most of the metadata is collected from the file header.
To ensure rendering, please ensure all file headers start with #
,
and separating lines contain a #
.
Header scanning will stop as soon as an empty line is encountered.
Example, this will not see the "Supports" section as a header field, and thus will not include it.
#!/bin/bash
#
# Some title
# Supports:
# Debian 12
Correct form includes a '#' to ensure the entire block is seen as the file header.
#!/bin/bash
#
# Some title
#
# Supports:
# Debian 12
The first non-empty line retrieved from the script will be used as the title, (one line only).
Lists how to run the application to the end user, and gets saved in the help icon in TRMM.
# Syntax:
# --option1 - Short description of option 1
# --option2=... - Short description of option 2
Optionally, you can include the destination variable name before each argument
to allow for dynamic generation of the argument parsing via compile:argparse
.
In this example, passing --noninteractive
will set the variable NONINTERACTIVE
to 1
.
(The compiler will filter out the prefix)
# Syntax:
# NONINTERACTIVE=--noninteractive - Run in non-interactive mode, (will not ask for prompts)
# VERSION=--version=... - Version of Zabbix to install (default: 7.0)
# ZABBIX_SERVER=--server=... - Hostname or IP of Zabbix server
# ZABBIX_AGENT_HOSTNAME=--hostname=... - Hostname of local device for matching with a Zabbix host entry
When called with:
# compile:argparse
Lists the default arguments and their values to be used when running the script in TRMM.
DOES support TRMM variable replacement for site, client, and agent.
To use these, wrap the variable in double curly braces, like so: {{client.zabbix_hostname}}
# TRMM Arguments:
# --option1
# --option2=something
Behaves the same as TRMM Arguments, but is used for environment variables.
# TRMM Environment:
# VAR1=something
# VAR2={{client.zabbix_hostname}}
Lists the OS support for the script.
# Supports:
# Debian 12
# Ubuntu 24.04
Distros can be listed individually, or one of the group declarations for multiple distros.
- Linux-All - All Linux-based distros (completely os-agnostic script)
- Debian-All - Any Debian-based distro (Debian, Ubuntu, Mint, etc)
- RHEL-All - Any Red Hat-based distro (RHEL, CentOS, Fedora, etc)
# @AUTHOR Some Name <[email protected]>
# @CATEGORY Some Category
# @TRMM-TIMEOUT 120
The compiler can generate dynamic code based on script comments, notably for usage and arguments
Will generate a "usage()" function with the description and syntax arguments.
# compile:usage