Skip to content

Instantly share code, notes, and snippets.

@slaysd
Created March 24, 2020 01:04
Show Gist options
  • Select an option

  • Save slaysd/ae6d76505a5343b985399965d6b6ee87 to your computer and use it in GitHub Desktop.

Select an option

Save slaysd/ae6d76505a5343b985399965d6b6ee87 to your computer and use it in GitHub Desktop.

Revisions

  1. slaysd created this gist Mar 24, 2020.
    14 changes: 14 additions & 0 deletions remove_vpn_user.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,14 @@
    #!/bin/bash

    if [ $# -ne 2 ]
    then
    echo "Usage: $0 <CLIENT_KEY_NAME> <NAMESPACE>"
    exit
    fi

    KEY_NAME=$1
    NAMESPACE=$2
    HELM_RELEASE=jx

    POD_NAME=$(kubectl get pods -n "$NAMESPACE" -l "app=openvpn,release=$HELM_RELEASE" -o jsonpath='{.items[0].metadata.name}')
    kubectl -n "$NAMESPACE" exec -it "$POD_NAME" /etc/openvpn/setup/revokeClientCert.sh $KEY_NAME