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 log::error "Service not found: ${filter_service}"
2 return 1
3 fi
4 fi
5 [[ -n "$filter_ip" ]] && service_ip="$filter_ip"
6
7 # Fetch aggregated data
8 local data
9 data=$(json::activity_aggregate \
10 "$(ctx::fw_events_log)" \

nuno / gistfile1.txt

0 likes
0 forks
1 files
Last active 3 months ago
1 98: data=$(json::activity_aggregate \
2 99: "$(ctx::fw_events_log)" \
3 100: "$(ctx::events_log)" \
4 102: "$(ctx::net)" \
5 103: "$(ctx::clients)" \
6 104: "$(ctx::meta)" \
7 234: data=$(json::activity_aggregate \
8 235: "$(ctx::fw_events_log)" "$(ctx::events_log)" \
9 236: "$(config::interface)" "$(ctx::net)" \
10 237: "$(ctx::clients)" "$(ctx::meta)" \

nuno / gistfile1.txt

0 likes
0 forks
1 files
Last active 3 months ago
1 wc -l /etc/wireguard/wgctl/core/lib/events.py
2 head -30 /etc/wireguard/wgctl/core/lib/events.py
3 673 /etc/wireguard/wgctl/core/lib/events.py
4 """
5 events.py — WireGuard and firewall event processing.
6 """
7
8 import os
9 import json
10 import sys

nuno / gistfile1.txt

0 likes
0 forks
1 files
Last active 3 months ago
1 function cmd::test::run_cmd() {
2 local desc="$1" expected="${2:-}"
3 shift 2
4
5 local tmp exit_code
6 tmp=$(mktemp)
7
8 set +e
9 timeout 30 "$WGCTL_BINARY" "$@" > "$tmp" 2>&1
10 exit_code=$?

nuno / gistfile1.txt

0 likes
0 forks
1 files
Last active 3 months ago
1 function cmd::unblock::run() {
2 local name="" identity="" type=""
3 local ips=() subnets=() ports=() services=()
4 local all=false quiet=false force=false
5 local reason=""
6
7 while [[ $# -gt 0 ]]; do
8 case "$1" in
9 --name) name="$2"; shift 2 ;;
10 --identity) identity="$2"; shift 2 ;;

nuno / gistfile1.txt

0 likes
0 forks
1 files
Last active 3 months ago
1 function cmd::block::run() {
2 local name="" identity="" type="" block_name=""
3 local ips=() subnets=() ports=() services=()
4 local quiet=false force=false
5 local reason=""
6
7 while [[ $# -gt 0 ]]; do
8 case "$1" in
9 --name) name="$2"; shift 2 ;;
10 --identity) identity="$2"; shift 2 ;;

nuno / gistfile1.txt

0 likes
0 forks
1 files
Last active 3 months ago
1 function cmd::block::run() {
2 local name="" identity="" type="" block_name=""
3 local ips=() subnets=() ports=() services=()
4 local quiet=false force=false
5
6 while [[ $# -gt 0 ]]; do
7 case "$1" in
8 --name) name="$2"; shift 2 ;;
9 --identity) identity="$2"; shift 2 ;;
10 --type) type="$2"; shift 2 ;;

nuno / gistfile1.txt

0 likes
0 forks
1 files
Last active 3 months ago
1 /etc/wireguard/wgctl/commands/block.command.sh:7:function cmd::block::on_load() {
2 /etc/wireguard/wgctl/commands/block.command.sh:25:function cmd::block::help() {
3 /etc/wireguard/wgctl/commands/block.command.sh:60:function cmd::block::run() {
4 /etc/wireguard/wgctl/commands/block.command.sh:219:function cmd::block::_block_identity() {
5 /etc/wireguard/wgctl/commands/block.command.sh:254:function cmd::block::_get_endpoint() {
6 /etc/wireguard/wgctl/commands/block.command.sh:264:function cmd::block::_block_all() {
7 /etc/wireguard/wgctl/commands/unblock.command.sh:7:function cmd::unblock::on_load() {
8 /etc/wireguard/wgctl/commands/unblock.command.sh:25:function cmd::unblock::help() {
9 /etc/wireguard/wgctl/commands/unblock.command.sh:58:function cmd::unblock::run() {
10 /etc/wireguard/wgctl/commands/unblock.command.sh:190:function cmd::unblock::_unblock_identity() {

nuno / gistfile1.txt

0 likes
0 forks
1 files
Last active 3 months ago
1 function cmd::test::unit_json_output() {
2 test::section "Unit: JSON output"
3
4 command::_load_mixins 2>/dev/null || true
5
6 # json::envelope produces valid structure
7 local result
8 result=$(echo '{"peers":[]}' | json::envelope "list" "0")
9 cmd::test::assert "envelope ok field" "$(echo "$result" | grep -o '"ok":true')" '"ok":true'
10 cmd::test::assert "envelope command field" "$(echo "$result" | grep -o '"command":"list"')" '"command":"list"'

nuno / gistfile1.txt

0 likes
0 forks
1 files
Last active 3 months ago
1 sed -n '/^function cmd::test::section_peer_cmd/,/^}/p' \
2 /etc/wireguard/wgctl/commands/test/integration.sh
3 function cmd::test::section_peer_cmd() {
4 test::section "Peer command"
5
6 "$WGCTL_BINARY" remove --name phone-testunit --force > /dev/null 2>&1 || true
7 "$WGCTL_BINARY" add --name testunit --type phone > /dev/null 2>&1
8
9 # update-dns
10 cmd::test::run_cmd "peer update-dns --name" "Updated DNS" peer update-dns --name phone-testunit
Newer Older

Powered by Opengist ⋅ Load: 100ms⋅

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