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

nuno

Joined 4 months ago

Recently created
Least recently created
Recently updated
Least recently updated
All gists 582

nuno / gistfile1.txt

0 likes
0 forks
1 files
Last active 3 months ago
1 function cmd::add::run() {
2 local name=""
3 local type=""
4 local subtype=""
5 local rule=""
6 local ip=""
7 local tunnel=""
8 local guest=false
9 local presets=()
10 local show_config=false

nuno / gistfile1.txt

0 likes
0 forks
1 files
Last active 3 months ago
1 timeout 5 /usr/local/bin/wgctl fw list > /dev/null
2
3 echo "exit: $?"
4
5 exit: 0
6
7
8
9 All good there.

nuno / gistfile1.txt

0 likes
0 forks
1 files
Last active 3 months ago
1 ────────────────────────────────────────────────
2 wgctl Test Suite
3 ────────────────────────────────────────────────
4
5 List
6 ──────────────────────────────────────────────────
7 ✅ list
8 ✅ list --online
9 ✅ list --offline
10 ✅ list --blocked

nuno / gistfile1.txt

0 likes
0 forks
1 files
Last active 3 months ago
1 root@wireguard:/etc/wireguard/wgctl# wgctl test
2
3 ────────────────────────────────────────────────
4 wgctl Test Suite
5 ────────────────────────────────────────────────
6
7 List
8 ──────────────────────────────────────────────────
9 ✅ list
10 ✅ list --online

nuno / gistfile1.txt

0 likes
0 forks
1 files
Last active 3 months ago
1 135 function cmd::add::run() {
2 115 function cmd::list::run() {
3 109 function cmd::block::run() {
4 91 function cmd::rule::show() {
5 89 function cmd::unblock::run() {
6 89 function cmd::rename::run() {
7 83 function cmd::remove::run() {
8 81 function cmd::list::show_client() {
9 78 function cmd::watch::tail_events() {
10 67 function cmd::group::show() {

nuno / gistfile1.txt

0 likes
0 forks
1 files
Last active 3 months ago
1 root@wireguard:/etc/wireguard# wgctl list
2 test
3 KEY='DATE_FORMAT' VALUE='eu'
4 => DEBUG: 🔍 config: setting date format to eu
5 DEBUG fmt::set_date_format called with: eu
6 DEBUG FMT_DATETIME now: %d/%m/%Y %H:%M
7 DEBUG fmt::set_date_format called with: eu
8 DEBUG FMT_DATETIME now: %d/%m/%Y %H:%M
9
10 ────────────────────────────────────────────────

nuno / gistfile1.txt

0 likes
0 forks
1 files
Last active 3 months ago
1 declare -f config::load
2 config::load ()
3 {
4 local conf_file;
5 conf_file="$(ctx::data)/wgctl.conf";
6 [[ ! -f "$conf_file" ]] && return 0;
7 echo "test";
8 while IFS='=' read -r key value; do
9 echo "KEY='$key' VALUE='$value'";
10 [[ "$key" =~ ^[[:space:]]*# ]] && continue;

nuno / gistfile1.txt

0 likes
0 forks
1 files
Last active 3 months ago
1 function cmd::list::_render_summary() {
2 local group_summary="${1:-}"
3 local -n _rule_counts="$2"
4 local total="${3:-}" # filtered total
5
6 # total=$(find "$(ctx::clients)" -name "*.conf" | wc -l | tr -d ' ')
7
8 # Count total from rule_counts (only filtered peers)
9 local total=0
10 for r in "${!_rule_counts[@]}"; do

nuno / gistfile1.txt

0 likes
0 forks
1 files
Last active 3 months ago
1 # ── Table view ─────────────────────────────
2
3 log::section "WireGuard Clients"
4 cmd::list::_render_header $has_groups
5
6 for conf in "${dir}"/*.conf; do
7 [[ -f "$conf" ]] || continue
8
9 local client_name
10 client_name=$(basename "$conf" .conf)

nuno / gistfile1.txt

0 likes
0 forks
1 files
Last active 3 months ago
1 # ── Detailed mode ──────────────────────────
2
3 if $detailed; then
4 log::section "WireGuard Clients"
5 for conf in "${dir}"/*.conf; do
6 [[ -f "$conf" ]] || continue
7 local client_name
8 client_name=$(basename "$conf" .conf)
9 local ip="${p_ips[$client_name]}"
10 local type
Newer Older

Powered by Opengist ⋅ Load: 111ms⋅

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