openvpn-on-learn-address.sh 404 Bytes
Newer Older
Girish Ramakrishnan's avatar
Girish Ramakrishnan committed
1 2 3 4 5 6 7 8 9 10 11 12 13
#!/usr/bin/env bash

set -eu

# the args to this script are operation(add/update/delete), IP, CN
operation="$1"
ip="$2"
cn="${3:-}" # absent for deletes

curl -sS 'http://127.0.0.1:3000/api/onLearnAddress/' -X POST \
    --data-urlencode "operation=${operation}" \
    --data-urlencode "cn=${cn}" \
    --data-urlencode "vpnIp=${ip}" \
14 15 16
    --data-urlencode "token@/run/admin-token" \
    --max-time 15

Girish Ramakrishnan's avatar
Girish Ramakrishnan committed
17