diff options
Diffstat (limited to 'dotfiles/system/.profile.d/fzf.sh')
| -rw-r--r-- | dotfiles/system/.profile.d/fzf.sh | 14 | 
1 files changed, 13 insertions, 1 deletions
| diff --git a/dotfiles/system/.profile.d/fzf.sh b/dotfiles/system/.profile.d/fzf.sh index 2193614..f195440 100644 --- a/dotfiles/system/.profile.d/fzf.sh +++ b/dotfiles/system/.profile.d/fzf.sh @@ -76,9 +76,11 @@ bk() {      fi  } + +  # close wireguard connection first if already running, then  # run wireguard, selecting the configuration file. -wg() { +wgup() {      # Check if wireguard is running      output=$(sudo wg)      if [[ -n "$output" ]]; then @@ -95,3 +97,13 @@ wg() {          sudo wg      fi  } +wgdown() { +    # Check if wireguard is running +    output=$(sudo wg) +    if [[ -n "$output" ]]; then +        # Shutdown all wg interfaces if WireGuard is currently running. +        for iface in $(sudo wg show interfaces); do +            sudo wg-quick down "${iface}" +        done +    fi +} | 
