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 /etc/wireguard/wgctl/commands/group.command.sh:305:function cmd::group::rename() {
2 /etc/wireguard/wgctl/commands/group.command.sh:851:function cmd::group::purge_stale() {
3 /etc/wireguard/wgctl/modules/block.module.sh:101:function block::rename() {
4 /etc/wireguard/wgctl/modules/group.module.sh:26:function group::add_peer() {
5 /etc/wireguard/wgctl/modules/group.module.sh:31:function group::remove_peer() {
6 /etc/wireguard/wgctl/modules/group.module.sh:55:function group::remove_peer_from_all() {
7 /etc/wireguard/wgctl/modules/identity.module.sh:211:function identity::rename_peer() {
8 /etc/wireguard/wgctl/modules/peers.module.sh:323:function peers::rename_meta() {

nuno / gistfile1.txt

0 likes
0 forks
1 files
Last active 3 months ago
1 oot@wireguard:/etc/wireguard# wgctl group add --name test-group-123 --desc "test"
2 => OK: βœ… πŸ”’ Group created: test-group-123
3 root@wireguard:/etc/wireguard# wgctl group show --name test-group-123
4
5 ────────────────────────────────────────────────
6 Group: test-group-123
7 ────────────────────────────────────────────────
8
9 Description: test
10 Peers: 0 peers

nuno / gistfile1.txt

0 likes
0 forks
1 files
Last active 3 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 3 months ago
1 function cmd::group::run() {
2 local subcmd="${1:-help}"
3 shift || true
4
5 if command::json; then
6 cmd::group::_output_json
7 return 0
8 fi
9
10 case "$subcmd" in

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::group::on_load() {
8 flag::register --name
9 flag::register --desc
10 flag::register --peer

nuno / gistfile1.txt

0 likes
0 forks
1 files
Last active 3 months ago
1 7:function cmd::group::on_load() {
2 25:function cmd::group::help() {
3 83:function cmd::group::run() {
4 121:function cmd::group::list() {
5 167:function cmd::group::show() {
6 231:function cmd::group::_render_table() {
7 246:function cmd::group::add() {
8 274:function cmd::group::remove() {
9 305:function cmd::group::rename() {
10 341:function cmd::group::peer() {

nuno / gistfile1.txt

0 likes
0 forks
1 files
Last active 3 months ago
1 local subcmd_file="$(ctx::commands)/${cmd}/${subcmd}.sh"
2 if [[ -f "$subcmd_file" ]]; then
3 _CURRENT_LOADING_CMD="${cmd}::${subcmd}"
4 _CURRENT_COMMAND="${cmd}::${subcmd}"
5 source "$subcmd_file"
6 core::call_if_exists "cmd::${cmd}::${subcmd}::on_load"
7 _CURRENT_LOADING_CMD=""
8
9 for arg in "$@"; do
10 [[ "$arg" == "--help" || "$arg" == "-h" ]] && {

nuno / gistfile1.txt

0 likes
0 forks
1 files
Last active 3 months ago
1 root@wireguard:/etc/wireguard/wgctl# sed -n '340,360p' /etc/wireguard/wgctl/core/framework/command.sh
2 fi
3
4 log::debug "about to load_subcmd: cmd=$cmd subcmd=$subcmd"
5 # Lazy load subcommand file
6 local subcmd_file="$(ctx::commands)/${cmd}/${subcmd}.sh"
7 if [[ -f "$subcmd_file" ]]; then
8 _CURRENT_LOADING_CMD="${cmd}::${subcmd}"
9 _CURRENT_COMMAND="${cmd}::${subcmd}"
10 source "$subcmd_file"

nuno / gistfile1.txt

0 likes
0 forks
1 files
Last active 3 months ago
1 cmd_dir="${WGCTL_DIR}/commands/${cmd}"
2
3 local subcmd_file="${cmd_dir}/${subcmd}.sh"
4 log::debug "looking for: $subcmd_file exists=$([ -f "$subcmd_file" ] && echo yes || echo no)"
5 [[ ! -f "$subcmd_file" ]] && return 1
6
7 _CURRENT_LOADING_CMD="${cmd}::${subcmd}"
8 _CURRENT_COMMAND="${cmd}::${subcmd}"
9 source "$subcmd_file"

nuno / gistfile1.txt

0 likes
0 forks
1 files
Last active 3 months ago
1 function command::load_subcmd() {
2 local cmd="$1" subcmd="$2"
3 [[ -z "$cmd" || -z "$subcmd" ]] && return 1
4
5 # Determine file path β€” commands/<cmd>/<subcmd>.sh
6 local cmd_dir
7 cmd_dir="${WGCTL_DIR}/commands/${cmd}"
8
9 local subcmd_file="${cmd_dir}/${subcmd}.sh"
10 [[ ! -f "$subcmd_file" ]] && return 1
Newer Older

Powered by Opengist β‹… Load: 97msβ‹…

English
ČeΕ‘tina Deutsch English EspaΓ±ol FranΓ§ais Magyar Italiano ζ—₯本θͺž Polski PortuguΓͺs Русский TΓΌrkΓ§e Π£ΠΊΡ€Π°Ρ—Π½ΡΡŒΠΊΠ° δΈ­ζ–‡ 繁體中文
β‹… KrilHub