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 5 months ago
1 /etc/wireguard/wgctl/commands/list.command.sh \
2 /etc/wireguard/wgctl/commands/block.command.sh \
3 /etc/wireguard/wgctl/commands/unblock.command.sh \
4 /etc/wireguard/wgctl/commands/inspect.command.sh 2>/dev/null
5 /etc/wireguard/wgctl/commands/list.command.sh:function cmd::list::help() {
6 /etc/wireguard/wgctl/commands/list.command.sh- cat <<EOF
7 /etc/wireguard/wgctl/commands/list.command.sh-Usage: wgctl list [options]
8 /etc/wireguard/wgctl/commands/list.command.sh-
9 /etc/wireguard/wgctl/commands/list.command.sh-List all WireGuard clients.
10 /etc/wireguard/wgctl/commands/list.command.sh-

nuno / gistfile1.txt

0 likes
0 forks
1 files
Last active 5 months ago
1 function peers::cleanup_config() {
2 local config
3 config=$(config::config_file)
4
5 python3 -c "
6 import re
7 config = open('${config}').read()
8
9 # Normalize multiple blank lines to single blank line
10 config = re.sub(r'\n{3,}', '\n\n', config)

nuno / gistfile1.txt

0 likes
0 forks
1 files
Last active 5 months ago
1 function cmd::group::show() {
2 local name=""
3
4 while [[ $# -gt 0 ]]; do
5 case "$1" in
6 --name) util::require_flag "--name" "${2:-}" || return 1; name="$2"; shift 2 ;;
7 --help) cmd::group::help; return ;;
8 *) log::error "Unknown flag: $1"; return 1 ;;
9 esac
10 done

nuno / gistfile1.txt

0 likes
0 forks
1 files
Last active 5 months ago
1 function cmd::list::_render_row() {
2 local client_name="$1" ip="$2" type="$3"
3
4 local pubkey="${p_pubkeys[$client_name]:-}"
5 local handshake_ts="${wg_handshakes[$pubkey]:-0}"
6 local is_blocked="${p_blocked[$client_name]:-false}"
7 local is_restricted="${p_restricted[$client_name]:-false}"
8 local last_ts="${p_last_ts[$client_name]:-}"
9
10 # Apply status filters

nuno / gistfile1.txt

0 likes
0 forks
1 files
Last active 5 months ago
1 UNUSED: cmd::add::on_load
2 UNUSED: cmd::audit::on_load
3 UNUSED: cmd::audit::run
4 UNUSED: cmd::block::on_load
5 UNUSED: cmd::config::on_load
6 UNUSED: cmd::config::run
7 UNUSED: cmd::fw::on_load
8 UNUSED: cmd::fw::run
9 UNUSED: cmd::fw::stats
10 UNUSED: cmd::group::on_load

nuno / gistfile1.txt

0 likes
0 forks
1 files
Last active 5 months ago
1 wgctl test --fn cmd::unblock::run --verbose
2
3 ────────────────────────────────────────────────
4 Function Test: cmd::unblock::run
5 ────────────────────────────────────────────────
6
7 cmd::unblock::run
8 ──────────────────────────────────────────────────
9
10 ────────────────────────────────────────────────

nuno / rule.command.sh

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

nuno / unblock.command.sh

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

nuno / rename.command.sh

0 likes
0 forks
1 files
Last active 5 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 / rename.command.sh

0 likes
0 forks
1 files
Last active 5 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
Newer Older

Powered by Opengist ⋅ Load: 104ms⋅

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