Skip to content

cdp1337/ScriptsCollection

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

59 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Scripts Collection

A collection of useful scripts for various Linux distributions

Scripts

Category Script Type Supports
Asset Tracking Collect Asset Inventory (SuiteCRM) Python archlinux centos debian fedora linuxmint redhat rocky suse ubuntu
Asset Tracking Collect Asset Inventory (SuiteCRM) Powershell windows
Game Server Install ARK Survival Ascended Dedicated Server Shell debian ubuntu
Game Server Install Project Zomboid Shell debian ubuntu
Hardware Disk Drive Health Check Shell archlinux centos debian fedora linuxmint redhat rocky ubuntu
Security Firewall - Check Status Shell archlinux centos debian fedora linuxmint redhat rocky suse ubuntu
Security Install Firewall (UFW) Shell archlinux centos debian fedora linuxmint redhat rocky suse ubuntu
System Monitoring Install Zabbix Agent2 Shell centos debian redhat rocky ubuntu
System Monitoring Install Zabbix Proxy Shell centos debian redhat rocky ubuntu
User Management Authorize SSH key for a user Python archlinux centos debian fedora linuxmint redhat rocky suse ubuntu
User Management Firewall - Whitelist IP Shell archlinux centos debian fedora linuxmint redhat rocky suse ubuntu
Uncategorized src/test-firewall/test.sh Shell

Compile all scripts

Will compile each script into a single distributable file with all dependencies included within.

python3 compile.py

Script Metadata

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

Script Header

The first non-empty line retrieved from the script will be used as the title, (one line only).

Syntax

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

TRMM Arguments

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

TRMM Environment

Behaves the same as TRMM Arguments, but is used for environment variables.

# TRMM Environment:
#   VAR1=something
#   VAR2={{client.zabbix_hostname}}

Supports

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 Tag

# @AUTHOR  Some Name <[email protected]>

Category Tag

# @CATEGORY  Some Category

TRMM Timeout Setting

# @TRMM-TIMEOUT  120

Generative Code

The compiler can generate dynamic code based on script comments, notably for usage and arguments

Compile usage()

Will generate a "usage()" function with the description and syntax arguments.

# compile:usage

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published