All New

user:thomas gists created by user

title:mygist gists with given title

description:sync gists with given description

filename:myfile.txt gists having files with given name

extension:yml gists having files with given extension

language:go gists having files with given language

topic:homelab gists with given topic

all:systemctl search all fields

Register

Login

All New Register Login

All gists

Recently created
Least recently created
Recently updated
Least recently updated

nuno / gistfile1.txt

0 likes
0 forks
1 files
Last active 3 months ago
1 #!/usr/bin/env bash
2
3 # ============================================
4 # Command Registry
5 # ============================================
6
7 declare -A _LOADED_COMMANDS=()
8
9 readonly _COMMAND_NAMESPACE="cmd"
10 readonly _COMMAND_AUTO_LOAD_HOOK="on_load"

nuno / gistfile1.txt

0 likes
0 forks
1 files
Last active 3 months ago
1 #!/usr/bin/env bash
2
3 # ============================================
4 # Lifecycle
5 # ============================================
6
7 function cmd::rename::on_load() {
8 flag::register --name
9 flag::register --type
10 flag::register --new-name

nuno / gistfile1.txt

0 likes
0 forks
1 files
Last active 3 months ago
1 #!/usr/bin/env bash
2
3 # ============================================
4 # Lifecycle
5 # ============================================
6
7 function cmd::remove::on_load() {
8 flag::register --name
9 flag::register --type
10 flag::register --force

nuno / gistfile1.txt

0 likes
0 forks
1 files
Last active 3 months ago
1 #!/usr/bin/env bash
2
3 WGCTL_BINARY="$(command -v wgctl)"
4
5 # ============================================
6 # Lifecycle
7 # ============================================
8
9 function cmd::test::on_load() {
10 flag::register --destructive

nuno / gistfile1.txt

0 likes
0 forks
1 files
Last active 3 months ago
1 function load_module() {
2 local name="$1"
3
4 module::loaded "$name" && return 0
5
6 local path
7 path="$(ctx::modules)/${name}.module.sh"
8
9 if [[ ! -f "$path" ]]; then
10 log::error "Module not found: ${name} (${path})"

nuno / gistfile1.txt

0 likes
0 forks
1 files
Last active 3 months ago
1 #!/usr/bin/env bash
2
3 # ============================================
4 # IP Assignment
5 # ============================================
6
7 function ip::assigned() {
8 grep -h "^Address" "$(ctx::clients)"/*.conf 2>/dev/null \
9 | awk '{print $3}' \
10 | cut -d'/' -f1

nuno / gistfile1.txt

0 likes
0 forks
1 files
Last active 3 months ago
1 #!/usr/bin/env bash
2
3 # ============================================
4 # Lifecycle
5 # ============================================
6
7 function config::on_load() {
8 config::_init_defaults
9 config::load
10 config::validate

nuno / gistfile1.txt

0 likes
0 forks
1 files
Last active 3 months ago
1 #!/usr/bin/env bash
2
3 # ============================================
4 # Lifecycle
5 # ============================================
6
7 function cmd::add::on_load() {
8 flag::register --name
9 flag::register --type
10 flag::register --subtype

nuno / gistfile1.txt

0 likes
0 forks
1 files
Last active 3 months ago
1 #!/usr/bin/env bash
2
3 # ============================================
4 # Lifecycle
5 # ============================================
6
7 function cmd::remove::on_load() {
8 flag::register --name
9 flag::register --type
10 flag::register --force

nuno / gistfile1.txt

0 likes
0 forks
1 files
Last active 3 months ago
1 #!/usr/bin/env bash
2
3 # ============================================
4 # Core
5 # ============================================
6
7 LOG_LEVEL=${LOG_LEVEL:-INFO}
8
9 # ============================================
10 # Internal
Newer Older

Powered by Opengist ⋅ Load: 98ms⋅

English
Čeština Deutsch English Español Français Magyar Italiano 日本語 Polski Português Русский Türkçe Українська 中文 繁體中文
⋅ KrilHub