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 root@wireguard:~# wgctl group block --name test
2 Traceback (most recent call last):
3 File "<string>", line 1, in <module>
4 File "/usr/lib/python3.11/json/__init__.py", line 293, in load
5 return loads(fp.read(),
6 ^^^^^^^^^^^^^^^^
7 File "/usr/lib/python3.11/json/__init__.py", line 346, in loads
8 return _default_decoder.decode(s)
9 ^^^^^^^^^^^^^^^^^^^^^^^^^^
10 File "/usr/lib/python3.11/json/decoder.py", line 337, in decode

nuno / gistfile1.txt

0 likes
0 forks
1 files
Last active 3 months ago
1 root@wireguard:~# wgctl group unblock --name test
2 => DEBUG: ๐Ÿ” _unblock_peer: restoring phone-test
3 => DEBUG: ๐Ÿ” Unblocked all traffic from: 10.1.3.5
4 => DEBUG: ๐Ÿ” flush_peer: starting for 10.1.3.5
5 => DEBUG: ๐Ÿ” flush_peer: removed 0 FORWARD rules for: 10.1.3.5
6 => DEBUG: ๐Ÿ” Unwatched client: phone-test
7 => DEBUG: ๐Ÿ” _unblock_peer: done
8 => DEBUG: ๐Ÿ” _unblock_peer: restoring phone-test1
9 => DEBUG: ๐Ÿ” Unblocked all traffic from: 10.1.3.6
10 => DEBUG: ๐Ÿ” flush_peer: starting for 10.1.3.6

nuno / gistfile1.txt

0 likes
0 forks
1 files
Last active 3 months ago
1 Unblocking:
2
3 root@wireguard:~# wgctl group unblock --name test
4
5 => DEBUG: ๐Ÿ” _unblock_peer: restoring phone-test
6
7 => DEBUG: ๐Ÿ” Unblocked all traffic from: 10.1.3.5
8
9 => DEBUG: ๐Ÿ” flush_peer: starting for 10.1.3.5

nuno / gistfile1.txt

0 likes
0 forks
1 files
Last active 3 months ago
1 root@wireguard:~# wgctl group block --name test
2 => DEBUG: ๐Ÿ” Blocked all traffic from: 10.1.3.5
3 => DEBUG: ๐Ÿ” Watching: phone-test ((none))
4 => DEBUG: ๐Ÿ” Removed peer from server config: phone-test
5 => DEBUG: ๐Ÿ” WireGuard config reloaded
6 => DEBUG: ๐Ÿ” Blocked all traffic from: 10.1.3.6
7 => DEBUG: ๐Ÿ” Watching: phone-test1 ((none))
8 => DEBUG: ๐Ÿ” Removed peer from server config: phone-test1
9 => DEBUG: ๐Ÿ” WireGuard config reloaded
10 => INFO: ๐Ÿšซ ๐Ÿ”’ All peers from test have been blocked (2 peers).

nuno / gistfile1.txt

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

nuno / helps.sh

0 likes
0 forks
1 files
Last active 3 months ago
1 function wgctl::help() {
2 cat <<EOF
3 $(log::section "wgctl โ€” WireGuard Management" 2>/dev/null || printf "\n wgctl โ€” WireGuard Management\n")
4
5 Usage: wgctl <command> [options]
6
7 Client Commands:
8 add, new Add a new client
9 remove, rm Remove a client
10 rename, mv Rename a client

nuno / shell.command.sh

0 likes
0 forks
1 files
Last active 3 months ago
1 #!/usr/bin/env bash
2
3 # ============================================
4 # Private helpers
5 # ============================================
6
7 function cmd::shell::_prompt() {
8 local user host dir
9 user=$(whoami)
10 host=$(hostname -s)

nuno / gistfile1.txt

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

nuno / gistfile1.txt

0 likes
0 forks
1 files
Last active 3 months ago
1 grep -A 15 "function rule::reapply_all" /etc/wireguard/wgctl/modules/rule.module.sh
2 function rule::reapply_all() {
3 local rule_name="${1:-}"
4 rule::require_exists "$rule_name" || return 1
5
6 local peers=()
7 mapfile -t peers < <(peers::with_rule "$rule_name")
8 [[ ${#peers[@]} -eq 0 ]] && return 0
9
10 local count=0

nuno / gistfile1.txt

0 likes
0 forks
1 files
Last active 3 months ago
1 sed -n '98,170p' /etc/wireguard/wgctl/modules/rule.module.sh
2
3 # ============================================
4 # Rule Application
5 # ============================================
6
7 function rule::apply() {
8 local rule_name="${1:?rule_name required}"
9 local client_ip="${2:?client_ip required}"
10 local peer_name="${3:-}"
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