https://github.com/eval-agency/scriptscollection
https://github.com/eval-agency/scriptscollection
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/eval-agency/scriptscollection
- Owner: eVAL-Agency
- License: agpl-3.0
- Created: 2024-08-10T03:20:32.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2025-02-05T14:26:14.000Z (over 1 year ago)
- Last Synced: 2025-03-19T09:54:20.660Z (over 1 year ago)
- Language: Shell
- Size: 395 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Scripts Collection
A collection of useful scripts for various Linux distributions
## Scripts
| Category / Script | Supports |
|-------------------|----------|
|  [Asset Tracking / Collect Asset Inventory (Grist) [Linux]](dist/inventory/linux_inventory_device_to_grist.py) [](dist/inventory/README.md) |  |
|  [Asset Tracking / Collect Asset Inventory (Grist) [Windows]](dist/inventory/windows_inventory_device_to_grist.ps1) [](dist/inventory/README.md) |  |
|  [Asset Tracking / Collect Asset Inventory (SuiteCRM) [Linux]](dist/inventory/linux_inventory_device_to_suitecrm.py) [](dist/inventory/README.md) |  |
|  [Asset Tracking / Collect Asset Inventory (SuiteCRM) [Windows]](dist/inventory/windows_inventory_device_to_suitecrm.ps1) [](dist/inventory/README.md) |  |
|  [Backup / Backup Nextcloud Server [Linux]](dist/nextcloud/linux_nextcloud_backup.sh) |  |
|  [Disks / Check Disk Health [Linux]](dist/disk/linux_check_disk_health.sh) |         |
|  [Disks / Check Disk Health [Windows]](dist/disk/windows_check_disk_health.ps1) |  |
|  [Disks / Check Disk Space [Linux]](dist/disk/linux_check_disk_space.py) |  |
|  [Disks / Check Disk Space [Windows]](dist/disk/windows_check_disk_space.ps1) | ") |
|  [Firewall / Check Firewall Status [Linux]](dist/firewall/linux_check_firewall.sh) |  |
|  [Firewall / Check Firewall Status [Windows]](dist/firewall/windows_check_firewall.ps1) |  |
|  [Firewall / Firewall - Allow IP/Port [Linux]](dist/firewall/linux_util_firewall_allow.sh) |  |
|  [Firewall / Firewall - Whitelist IP](dist/firewall/linux_util_firewall_whitelist_ip.sh) |  |
|  [Firewall / Install Firewall [Linux]](dist/firewall/linux_install_firewall.sh) |  |
|  [Licensing / Get Windows License Information](dist/windows/windows_inventory_get_windows_license.ps1) |  |
|  [Memory / Check Memory Usage [Linux]](dist/memory/linux_check_memory_usage.sh) |  |
|  [Memory / Check Memory Usage [Windows]](dist/memory/windows_check_memory_usage.ps1) |  |
|  [Monitoring / Install Graylog Sidecar [Linux]](dist/graylog/linux_install_graylog_sidecar.sh) |      |
|  [Monitoring / Install Zabbix Agent2 [Linux]](dist/zabbix/linux_install_zabbix_agent2.sh) |      |
|  [Monitoring / Install Zabbix Proxy [Linux]](dist/zabbix/linux_install_zabbix_proxy.sh) |      |
|  [Network Utility / Install net-diag utilities [Linux]](dist/net-diag/linux_install_net_diag.sh) |  |
|  [Networking / Set Hostname and Restart [Windows]](dist/hostname/windows_set_hostname.ps1) |  |
|  [Repo / Switch Repo to Community [Proxmox]](dist/proxmox/linux_manage_proxmox_repo_community.sh) |  |
|  [Security / Check Defender Status [Windows]](dist/defender/windows_check_defender_status.ps1) |  |
|  [Security / Install Firewall (UFW) [Linux]](dist/ufw/linux_install_ufw.sh) |  |
|  [Security / Virtualmin Renew All SSL [Linux]](dist/virtualmin/renew-all-letsencrypt-certs.sh) |  |
|  [System Cleanup / Remove Bloatware in Win10 [Windows]](dist/windows/windows_debloat_win10.ps1) |  |
|  [System / Install 7zip [Linux]](dist/7zip/linux_install_7zip.sh) |  |
|  [System / Install rar [Linux]](dist/rar/linux_install_rar.sh) |  |
|  [System / Install unrar [Linux]](dist/rar/linux_install_unrar.sh) |  |
|  [System / Install unzip [Linux]](dist/zip/linux_install_unzip.sh) |  |
|  [System / Install zip [Linux]](dist/zip/linux_install_zip.sh) |  |
|  [Updates / Check if Reboot Required [Linux]](dist/updates/linux_check_reboot_required.sh) |  |
|  [Updates / Check if Reboot Required [Windows]](dist/updates/windows_check_reboot_required.ps1) |  |
|  [User Management / Authorize SSH Key [Linux]](dist/ssh/linux_util_ssh_authorize.py) |  |
|  [User Management / Get SSH Public Key [Linux]](dist/ssh/linux_util_ssh_get_key.py) |  |
## Install as Python Package
This project can be installed as a Python package directly from GitHub, providing access to some Python libraries.
### Installation
```bash
pip install git+https://github.com/eVAL-Agency/ScriptsCollection.git
```
For development/editable installation:
```bash
git clone https://github.com/eVAL-Agency/ScriptsCollection.git
cd ScriptsCollection
pip install -e .
```
## Compile all scripts
Will compile each script into a single distributable file with all dependencies included within.
```bash
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.
```bash
#!/bin/bash
#
# Some title
# Supports:
# Debian 12
```
Correct form includes a '#' to ensure the entire block is seen as the file header.
```bash
#!/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.
```bash
#/bin/bash
# ...
# Syntax:
# --option1 - Short description of option 1
# --option2=... - Short description of option 2
```
```python
#!/usr/bin/env python3
"""
...
Syntax:
--option1 - Short description of option 1
--option2=... - Short description of option 2
"""
```
#### Argument Parsing
Adding `# compile:argparse` to the script will generate a dynamic argument parser for the script.
(BASH only) 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)
```bash
#/bin/bash
# ...
# 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
# ...
# compile:argparse
```
Generates:
```bash
#/bin/bash
# ...
# Syntax:
# --noninteractive - Run in non-interactive mode, (will not ask for prompts)
# --version=... - Version of Zabbix to install DEFAULT=7.0
# --server=... - Hostname or IP of Zabbix server
# --hostname=... - Hostname of local device for matching with a Zabbix host entry
# ...
# Parse arguments
NONINTERACTIVE="0"
VERSION="7.0"
ZABBIX_SERVER=""
ZABBIX_AGENT_HOSTNAME=""
while [ "$#" -gt 0 ]; do
case "$1" in
--noninteractive) NONINTERACTIVE=1; shift 1;;
--version=*) VERSION="${1#*=}"; shift 1;;
--server=*) ZABBIX_SERVER="${1#*=}"; shift 1;;
--hostname=*) ZABBIX_AGENT_HOSTNAME="${1#*=}"; shift 1;;
-h|--help) usage;;
esac
done
if [ -z "$SOURCE" ]; then
usage
fi
```
```python
#!/usr/bin/env python3
"""
Do something
Syntax:
--arg1= - Some parameter DEFAULT=yup
--arg2= - The SSH key to authorize DEFAULT=42
"""
import argparse
# ...
parser = argparse.ArgumentParser(
prog='scriptname.py',
description='Does a thing')
# compile:argparse
args = parser.parse_args()
```
#### Variable Type
To support Python, ensure a variable type is specified, like so:
```python
#!/usr/bin/env python3
"""
Syntax:
--option1= - Short description of option 1
--option2= - Short description of option 2
"""
```
Argument types in Bash are ignored and are for reference only.
#### Defaults
The default value can be specified by appending `DEFAULT=(value)` to the argument, like so:
```bash
#/bin/bash
# ...
# Syntax:
# --option1= - Short description of option 1 DEFAULT=default_value
# --option2= - Short description of option 2 DEFAULT=42
```
### 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}}`
```bash
#/bin/bash
# ...
# TRMM Arguments:
# --option1
# --option2=something
```
```python
#!/usr/bin/env python3
"""
...
Syntax:
--option1 - Short description of option 1
--option2=... - Short description of option 2
"""
```
### TRMM Environment
Behaves the same as TRMM Arguments, but is used for environment variables.
```bash
#/bin/bash
# ...
# TRMM Environment:
# VAR1=something
# VAR2={{client.zabbix_hostname}}
```
```python
#!/usr/bin/env python3
"""
...
TRMM Environment:
VAR1=something
VAR2={{client.zabbix_hostname}}
"""
```
### Supports
Lists the OS support for the script.
```bash
#/bin/bash
# ...
# Supports:
# Debian 12
# Ubuntu 24.04
```
```python
#!/usr/bin/env python3
"""
...
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)
* ArchLinux / arch
* CentOS
* Debian
* Fedora
* LinuxMint
* RedHat / RHEL
* Rocky / RockyLinux
* SuSE / OpenSuSE
* Ubuntu
* Windows
### Author Tag
```bash
#/bin/bash
# ...
# Author:
# Some Name
```
alternative syntax:
```bash
#/bin/bash
# ...
# @AUTHOR Some Name
```
```python
#!/usr/bin/env python3
"""
...
@AUTHOR Some Name
"""
```
### Category Tag
```bash
#/bin/bash
# ...
# Category:
# Some Category
```
alternative syntax:
```bash
#/bin/bash
# ...
# @CATEGORY Some Category
```
```python
#!/usr/bin/env python3
"""
...
Category:
Some Category
"""
```
### TRMM Timeout Setting
```bash
#/bin/bash
# ...
# @TRMM-TIMEOUT 120
```
```python
#!/usr/bin/env python3
"""
...
@TRMM-TIMEOUT 120
"""
```
### Draft
Set to true to skip finalizing of the script.
The script will still be generated to dist/, but will not be recorded in the README and TRMM metafile.
```bash
#/bin/bash
# ...
# Draft:
# True
```
```python
#!/usr/bin/env python3
"""
...
Draft:
True
"""
```
## 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.
```bash
# compile:usage
```
## Scriptlets
Scriptlets are small pieces of reusable code that can be included in scripts during compilation.
This system provides a number of scripts, and more can be added by adding a `compile.sources` file in the root of the project
with the format:
```
scriptlet_type=github:repo_owner/repo_name
```
Where `scriptlet_type` is the directory that contains the scriptlets to include.
By default `main` is used to download sources, but a different branch can be specified by appending `:branch_name`.
### [ufw/install.sh](scriptlets/ufw/install.sh)
To include this scriptlet:
```bash
# scriptlet:ufw/install.sh
```
#### function install_ufw:
Install UFW
### [io_github_lsferreira42/lib_ini.sh](scriptlets/io_github_lsferreira42/lib_ini.sh)
To include this scriptlet:
```bash
# scriptlet:io_github_lsferreira42/lib_ini.sh
```
#### function ini_debug:
Print debug messages
#### function ini_error:
Print error messages
#### function ini_validate_section_name:
Validate section name
#### function ini_validate_key_name:
Validate key name
#### function ini_create_temp_file:
Create a secure temporary file
#### function ini_trim:
Trim whitespace from start and end of a string
#### function ini_escape_for_regex:
Escape special characters in a string for regex matching
#### function ini_check_file:
#### function ini_read:
#### function ini_list_sections:
#### function ini_list_keys:
#### function ini_section_exists:
#### function ini_add_section:
#### function ini_write:
#### function ini_remove_section:
#### function ini_remove_key:
#### function ini_get_or_default:
#### function ini_import:
#### function ini_to_env:
#### function ini_key_exists:
#### function ini_read_array:
#### function ini_write_array:
### [openjdk/install.sh](scriptlets/openjdk/install.sh)
To include this scriptlet:
```bash
# scriptlet:openjdk/install.sh
```
#### function install_openjdk:
Install OpenJDK from Eclipse Adoptium
https://github.com/adoptium
@arg $1 string OpenJDK version to install
Will print the directory where OpenJDK was installed.
CHANGELOG:
2026.04.13 - Mute curl output
2026.03.07 - Bugfix to fix 'path-jre//bin/java'
2026.03.05 - Add support for update-alternatives / alternatives.
2026.03.03 - Bugfix, return the correct JDK directory.
2026.01.13 - Initial version
### [steam/install-steamcmd.sh](scriptlets/steam/install-steamcmd.sh)
To include this scriptlet:
```bash
# scriptlet:steam/install-steamcmd.sh
```
#### function install_steamcmd:
Install SteamCMD
CHANGELOG:
2025.12.16 - Ensure steam GPG key is readable by apt
2025.11.09 - Switch to using download to support curl/wget abstraction
2025.11.03 - Add support for Debian 13
2024.12.23 - Add support for non-interactive acceptance of Steam license
2024.12.22 - Initial version
### [firewalld/install.sh](scriptlets/firewalld/install.sh)
To include this scriptlet:
```bash
# scriptlet:firewalld/install.sh
```
#### function install_firewalld:
Install firewalld
CHANGELOG:
2026.03.16 - Switch awk to use $NF for better support
### [bz_eval_tui/print_header.sh](scriptlets/bz_eval_tui/print_header.sh)
To include this scriptlet:
```bash
# scriptlet:bz_eval_tui/print_header.sh
```
#### function print_header:
Print a header message
CHANGELOG:
2025.11.09 - Port from _common to bz_eval_tui
2024.12.25 - Initial version
### [bz_eval_tui/prompt_text.sh](scriptlets/bz_eval_tui/prompt_text.sh)
To include this scriptlet:
```bash
# scriptlet:bz_eval_tui/prompt_text.sh
```
#### function prompt_text:
Prompt user for a text response
Arguments:
--default="..." Default text to use if no response is given
Returns:
text as entered by user
CHANGELOG:
2025.11.23 - Use is_noninteractive to handle non-interactive mode
2025.01.01 - Initial version
### [bz_eval_tui/prompt_yn.sh](scriptlets/bz_eval_tui/prompt_yn.sh)
To include this scriptlet:
```bash
# scriptlet:bz_eval_tui/prompt_yn.sh
```
#### function prompt_yn:
Prompt user for a yes or no response
Arguments:
--invert Invert the response (yes becomes 0, no becomes 1)
--default-yes Default to yes if no response is given
--default-no Default to no if no response is given
-q Quiet mode (no output text after response)
Returns:
1 for yes, 0 for no (or inverted if --invert is set)
CHANGELOG:
2025.12.16 - Add text output for non-interactive and empty responses
2025.11.23 - Use is_noninteractive to handle non-interactive mode
2025.11.09 - Add -q (quiet) option to suppress output after prompt (and use return value)
2025.01.01 - Initial version
### [zabbix/repo-setup.sh](scriptlets/zabbix/repo-setup.sh)
To include this scriptlet:
```bash
# scriptlet:zabbix/repo-setup.sh
```
#### function zabbix_repo_setup:
Setup the Zabbix repo for this OS, shared between agent, agent2, server, and proxy.
### [xvfb/install.sh](scriptlets/xvfb/install.sh)
To include this scriptlet:
```bash
# scriptlet:xvfb/install.sh
```
#### function install_xvfb:
Install Xvfb and (optionally) a daemon helper
Syntax:
install_xvfb [--no-daemon] [--display ] [--service ]
Changelog:
20260216 - Initial version
### [_common/package_remove.sh](scriptlets/_common/package_remove.sh)
To include this scriptlet:
```bash
# scriptlet:_common/package_remove.sh
```
#### function package_remove:
Remove a package with the system's package manager.
Uses Redhat's yum, Debian's apt-get, and SuSE's zypper.
Usage:
```syntax-shell
package_remove apache2
```
@param $1..$N string
Package, (or packages), to remove. Accepts multiple packages at once.
### [_common/setconfigfile_orappend.sh](scriptlets/_common/setconfigfile_orappend.sh)
To include this scriptlet:
```bash
# scriptlet:_common/setconfigfile_orappend.sh
```
#### function setconfigfile_orappend:
Use sed to set a line in a config file
If the target line does not exist, it will simply get appended to the end
Arguments:
$1 Line match
$2 Line replace
$3 filename
Example:
setconfigfile_orappend "^Password=.*" "Password=1234" "/etc/myapp/myapp.conf"
CHANGELOG:
2025.04.10 - Escape '?' characters in the sed search
### [_common/random_password.sh](scriptlets/_common/random_password.sh)
To include this scriptlet:
```bash
# scriptlet:_common/random_password.sh
```
#### function random_password:
Generate a random password, (using characters that are easy to read and type)
### [_common/print_header.sh](scriptlets/_common/print_header.sh)
To include this scriptlet:
```bash
# scriptlet:_common/print_header.sh
```
### [_common/firewall_install.sh](scriptlets/_common/firewall_install.sh)
To include this scriptlet:
```bash
# scriptlet:_common/firewall_install.sh
```
#### function firewall_install:
Install the system default firewall based on the OS type
For Debian/Ubuntu, this installs UFW
For RHEL/CentOS, this installs firewalld
For SUSE, this installs firewalld
For other OS types, this defaults to installing UFW
### [_common/require_root.sh](scriptlets/_common/require_root.sh)
To include this scriptlet:
```bash
# scriptlet:_common/require_root.sh
```
### [_common/get_wan_ip.sh](scriptlets/_common/get_wan_ip.sh)
To include this scriptlet:
```bash
# scriptlet:_common/get_wan_ip.sh
```
#### function get_wan_ip:
Try to retrieve the WAN IP of this device based on ipify.org
CHANGELOG:
2025.12.15 - Use cmd_exists to fix regression bug
2025.11.23 - use which -s for cleaner checks
2025.11.09 - Initial version
### [_common/get_firewall.sh](scriptlets/_common/get_firewall.sh)
To include this scriptlet:
```bash
# scriptlet:_common/get_firewall.sh
```
#### function get_enabled_firewall:
Get which firewall is enabled,
or "none" if none located
#### function get_available_firewall:
Get which firewall is available on the local system,
or "none" if none located
CHANGELOG:
2025.12.15 - Use cmd_exists to fix regression bug
2025.04.10 - Switch from "systemctl list-unit-files" to "which" to support older systems
### [_common/prompt_text.sh](scriptlets/_common/prompt_text.sh)
To include this scriptlet:
```bash
# scriptlet:_common/prompt_text.sh
```
#### function prompt_text:
Prompt user for a text response
Arguments:
--default="..." Default text to use if no response is given
Returns:
text as entered by user
### [_common/cmd_exists.sh](scriptlets/_common/cmd_exists.sh)
To include this scriptlet:
```bash
# scriptlet:_common/cmd_exists.sh
```
#### function cmd_exists:
Simple wrapper to emulate `which -s`
The -s flag is not available on all systems, so this function
provides a consistent way to check for command existence
without having to include '&>/dev/null' everywhere.
Returns 0 on success, 1 on failure
Arguments:
$1 - Command to check
CHANGELOG:
2025.12.15 - Initial version (for a regression fix)
### [_common/firewall_allow.sh](scriptlets/_common/firewall_allow.sh)
To include this scriptlet:
```bash
# scriptlet:_common/firewall_allow.sh
```
#### function firewall_allow:
scriptlet:_common/get_firewall.sh
Add an "allow" rule to the firewall in the INPUT chain
Arguments:
--port Port(s) to allow
--source Source IP to allow (default: any)
--zone Zone to allow (default: public)
--tcp|--udp Protocol to allow (default: tcp)
--proto Protocol to allow (alternative method)
--comment (only UFW) Comment for the rule
Specify multiple ports with `--port '#,#,#'` or a range `--port '#:#'`
CHANGELOG:
2025.11.23 - Use return codes instead of exit to allow the caller to handle errors
2025.04.10 - Add "--proto" argument as alternative to "--tcp|--udp"
### [_common/download.sh](scriptlets/_common/download.sh)
To include this scriptlet:
```bash
# scriptlet:_common/download.sh
```
#### function download:
Simple download utility function
Uses either cURL or wget based on which is available
Downloads the file to a temp location initially, then moves it to the final destination
upon a successful download to avoid partial files.
Returns 0 on success, 1 on failure
Arguments:
--no-overwrite Skip download if destination file already exists
CHANGELOG:
2025.12.15 - Use cmd_exists to fix regression bug
2025.12.04 - Add --no-overwrite option to allow skipping download if the destination file exists
2025.11.23 - Download to a temp location to verify download was successful
- use which -s for cleaner checks
2025.11.09 - Initial version
### [_common/os_version.sh](scriptlets/_common/os_version.sh)
To include this scriptlet:
```bash
# scriptlet:_common/os_version.sh
```
#### function os_version:
Get the operating system version
Just the major version number is returned
### [_common/is_noninteractive.sh](scriptlets/_common/is_noninteractive.sh)
To include this scriptlet:
```bash
# scriptlet:_common/is_noninteractive.sh
```
#### function is_noninteractive:
Determine if the current shell session is non-interactive.
Checks NONINTERACTIVE, CI, DEBIAN_FRONTEND, and TERM.
Returns 0 (true) if non-interactive, 1 (false) if interactive.
CHANGELOG:
2025.12.16 - Remove TTY checks to avoid false positives in some environments
2025.11.23 - Initial version
### [_common/os.sh](scriptlets/_common/os.sh)
To include this scriptlet:
```bash
# scriptlet:_common/os.sh
```
#### function os:
Get the operating system
almalinux, alpine, amzn, antergos, arch, archarm, arcolinux,
centos, clear-linux-os, clearos,
debian,
elementary, endeavouros,
fedora, freebsd,
gentoo,
kali,
linuxmint,
mageia, manjaro,
nixos,
opensuse, ol,
pop,
raspbian, rhel, rocky,
scientific, slackware, sles,
ubuntu,
virtuozzo
### [_common/os_like.sh](scriptlets/_common/os_like.sh)
To include this scriptlet:
```bash
# scriptlet:_common/os_like.sh
```
#### function os_like:
Check if the OS is "like" a certain type
Returns 0 if true, 1 if false
Usage:
if os_like debian; then ... ; fi
#### function os_like_debian:
Check if the OS is "like" a certain type
ie: "ubuntu" will be like "debian"
Returns 0 if true, 1 if false
Prints 1 if true, 0 if false
Usage:
if [ "$(os_like_debian)" -eq 1 ]; then ... ; fi
if os_like_debian -q; then ... ; fi
#### function os_like_ubuntu:
Check if the OS is "like" a certain type
ie: "ubuntu" will be like "debian"
Returns 0 if true, 1 if false
Prints 1 if true, 0 if false
Usage:
if [ "$(os_like_ubuntu)" -eq 1 ]; then ... ; fi
if os_like_ubuntu -q; then ... ; fi
#### function os_like_rhel:
Check if the OS is "like" a certain type
ie: "ubuntu" will be like "debian"
Returns 0 if true, 1 if false
Prints 1 if true, 0 if false
Usage:
if [ "$(os_like_rhel)" -eq 1 ]; then ... ; fi
if os_like_rhel -q; then ... ; fi
#### function os_like_suse:
Check if the OS is "like" a certain type
ie: "ubuntu" will be like "debian"
Returns 0 if true, 1 if false
Prints 1 if true, 0 if false
Usage:
if [ "$(os_like_suse)" -eq 1 ]; then ... ; fi
if os_like_suse -q; then ... ; fi
#### function os_like_arch:
Check if the OS is "like" a certain type
ie: "ubuntu" will be like "debian"
Returns 0 if true, 1 if false
Prints 1 if true, 0 if false
Usage:
if [ "$(os_like_arch)" -eq 1 ]; then ... ; fi
if os_like_arch -q; then ... ; fi
#### function os_like_bsd:
Check if the OS is "like" a certain type
ie: "ubuntu" will be like "debian"
Returns 0 if true, 1 if false
Prints 1 if true, 0 if false
Usage:
if [ "$(os_like_bsd)" -eq 1 ]; then ... ; fi
if os_like_bsd -q; then ... ; fi
#### function os_like_macos:
Check if the OS is "like" a certain type
ie: "ubuntu" will be like "debian"
Returns 0 if true, 1 if false
Prints 1 if true, 0 if false
Usage:
if [ "$(os_like_macos)" -eq 1 ]; then ... ; fi
if os_like_macos -q; then ... ; fi
### [_common/package_install.sh](scriptlets/_common/package_install.sh)
To include this scriptlet:
```bash
# scriptlet:_common/package_install.sh
```
#### function package_install:
Install a package with the system's package manager.
Uses Redhat's yum, Debian's apt-get, and SuSE's zypper.
Usage:
```syntax-shell
package_install apache2 php7.0 mariadb-server
```
@param $1..$N string
Package, (or packages), to install. Accepts multiple packages at once.
CHANGELOG:
2026.01.09 - Cleanup os_like a bit and add support for RHEL 9's dnf
2025.04.10 - Set Debian frontend to noninteractive
### [_common/prompt_yn.sh](scriptlets/_common/prompt_yn.sh)
To include this scriptlet:
```bash
# scriptlet:_common/prompt_yn.sh
```
#### function prompt_yn:
Prompt user for a yes or no response
Arguments:
--invert Invert the response (yes becomes 0, no becomes 1)
--default-yes Default to yes if no response is given
--default-no Default to no if no response is given
Returns:
1 for yes, 0 for no (or inverted if --invert is set)
### [proton/install.sh](scriptlets/proton/install.sh)
To include this scriptlet:
```bash
# scriptlet:proton/install.sh
```
#### function install_proton:
Install Glorious Eggroll's Proton fork on a requested version
https://github.com/GloriousEggroll/proton-ge-custom
Will install Proton into /opt/script-collection/GE-Proton${VERSION}
with its pfx directory in /opt/script-collection/GE-Proton${VERSION}/files/share/default_pfx
@arg $1 string Proton version to install
CHANGELOG:
2025.11.23 - Use download scriptlet for downloading
2024.12.22 - Initial version
### [yum/repo_excludepkg.sh](scriptlets/yum/repo_excludepkg.sh)
To include this scriptlet:
```bash
# scriptlet:yum/repo_excludepkg.sh
```
#### function yum_repo_excludepkg:
Disable a package from a given yum repo
### [steam/steamcmd_get_app_details.py](scriptlets/steam/steamcmd_get_app_details.py)
To include this scriptlet:
```python
# from scriptlets.steam.steamcmd_get_app_details import *
```
### [steam/steamcmd_parse_manifest.py](scriptlets/steam/steamcmd_parse_manifest.py)
To include this scriptlet:
```python
# from scriptlets.steam.steamcmd_parse_manifest import *
```
#### function steamcmd_parse_manifest:
Parses a SteamCMD manifest file content and returns a dictionary
with the all the relevant information.
Example format of content to parse:
"2131400"
{
"common"
{
"name" "VEIN Dedicated Server"
"type" "Tool"
"parent" "1857950"
"ReleaseState" "released"
"oslist" "windows,linux"
"osarch" "64"
"osextended" ""
"icon" "7573f431d9ecd0e9dc21f4406f884b92152508fd"
"clienticon" "b5de75f7c5f84027200fdafe0483caaeb80f7dbe"
"clienttga" "6012ea81d68607ad0dfc5610e61f17101373c1fd"
"freetodownload" "1"
"associations"
{
}
"gameid" "2131400"
}
"extended"
{
"gamedir" ""
}
"config"
{
"installdir" "VEIN Dedicated Server"
"launch"
{
"0"
{
"executable" "VeinServer.exe"
"type" "default"
"config"
{
"oslist" "windows"
}
"description_loc"
{
"english" "VEIN Dedicated Server"
}
"description" "VEIN Dedicated Server"
}
"1"
{
"executable" "VeinServer.sh"
"type" "default"
"config"
{
"oslist" "linux"
}
"description_loc"
{
"english" "VEIN Dedicated Server"
}
"description" "VEIN Dedicated Server"
}
}
"uselaunchcommandline" "1"
}
"depots"
{
"228989"
{
"config"
{
"oslist" "windows"
}
"depotfromapp" "228980"
"sharedinstall" "1"
}
"228990"
{
"config"
{
"oslist" "windows"
}
"depotfromapp" "228980"
"sharedinstall" "1"
}
"2131401"
{
"config"
{
"oslist" "windows"
}
"manifests"
{
"public"
{
"gid" "3422721066391688500"
"size" "13373528354"
"download" "4719647568"
}
"experimental"
{
"gid" "5376672931011513884"
"size" "14053570688"
"download" "4881399680"
}
}
}
"2131402"
{
"config"
{
"oslist" "linux"
}
"manifests"
{
"public"
{
"gid" "4027172715479418364"
"size" "14134939630"
"download" "4869512928"
}
"experimental"
{
"gid" "643377871134354986"
"size" "14712396815"
"download" "4982816608"
}
}
}
"branches"
{
"public"
{
"buildid" "20727232"
"timeupdated" "1762674215"
}
"experimental"
{
"buildid" "20729593"
"description" "Bleeding-edge updates"
"timeupdated" "1762704776"
}
}
"privatebranches" "1"
}
}
:param manifest_content: str, content of the SteamCMD manifest file
:return: dict, parsed manifest data
### [steam/steamcmd_check_app_update.py](scriptlets/steam/steamcmd_check_app_update.py)
To include this scriptlet:
```python
# from scriptlets.steam.steamcmd_check_app_update import *
```
#### function steamcmd_check_app_update:
### [suitecrm/suitecrmsync.py](scriptlets/suitecrm/suitecrmsync.py)
To include this scriptlet:
```python
# from scriptlets.suitecrm.suitecrmsync import *
```
#### function __init__:
#### function update:
Patch/update a record in SuiteCRM
:param object_type:
:param object_id:
:param data:
:return
#### function create:
create a record in SuiteCRM
:param object_type:
:param data:
:return
#### function find:
:param object_type:
:param filters:
:param operator:
:param fields:
:return:
### [bz_eval_tui/print_header.py](scriptlets/bz_eval_tui/print_header.py)
To include this scriptlet:
```python
# from scriptlets.bz_eval_tui.print_header import *
```
### [bz_eval_tui/prompt_text.py](scriptlets/bz_eval_tui/prompt_text.py)
To include this scriptlet:
```python
# from scriptlets.bz_eval_tui.prompt_text import *
```
### [bz_eval_tui/table.py](scriptlets/bz_eval_tui/table.py)
To include this scriptlet:
```python
# from scriptlets.bz_eval_tui.table import *
```
#### function __init__:
Initialize the table with the columns to display
:param columns:
#### function add:
#### function render:
Render the table with the given list of services
:param services: Services[]
:return:
### [bz_eval_tui/prompt_yn.py](scriptlets/bz_eval_tui/prompt_yn.py)
To include this scriptlet:
```python
# from scriptlets.bz_eval_tui.prompt_yn import *
```
### [_common/cmd.py](scriptlets/_common/cmd.py)
To include this scriptlet:
```python
# from scriptlets._common.cmd import *
```
#### function __init__:
#### function json:
Get the output of the command decoded as JSON
:return:
#### function _exec:
### [_common/get_wan_ip.py](scriptlets/_common/get_wan_ip.py)
To include this scriptlet:
```python
# from scriptlets._common.get_wan_ip import *
```
### [_common/firewall_remove.py](scriptlets/_common/firewall_remove.py)
To include this scriptlet:
```python
# from scriptlets._common.firewall_remove import *
```
### [_common/firewall_allow.py](scriptlets/_common/firewall_allow.py)
To include this scriptlet:
```python
# from scriptlets._common.firewall_allow import *
```
### [_common/require_root.py](scriptlets/_common/require_root.py)
To include this scriptlet:
```python
# from scriptlets._common.require_root import *
```
### [_common/get_firewall.py](scriptlets/_common/get_firewall.py)
To include this scriptlet:
```python
# from scriptlets._common.get_firewall import *
```
### [org_python/venv_path_include.py](scriptlets/org_python/venv_path_include.py)
To include this scriptlet:
```python
# from scriptlets.org_python.venv_path_include import *
```
### [ssh/get_user_public_key.py](scriptlets/ssh/get_user_public_key.py)
To include this scriptlet:
```python
# from scriptlets.ssh.get_user_public_key import *
```
### [ssh/get_user_authorized_keys.py](scriptlets/ssh/get_user_authorized_keys.py)
To include this scriptlet:
```python
# from scriptlets.ssh.get_user_authorized_keys import *
```