Skip to content

Commit

Permalink
Auth notifications for unknown peers
Browse files Browse the repository at this point in the history
  • Loading branch information
leninalive committed Sep 6, 2024
1 parent bd6261a commit 7abb24c
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions contrib/peer-approver/approve.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ fi
ACCOUNT=(${ACCOUNT_STR//,/ })
ALLOWED_IPS=$(echo ${ACCOUNT[1]}|tr -d '"')
PSK=$(echo ${ACCOUNT[2]}|tr -d '"')
PSK_FILE=$(tempfile)
echo "${PSK}" > "${PSK_FILE}"

awg set "${INTERFACE_NAME}" peer "${PUBLIC_KEY}" allowed-ips "${ALLOWED_IPS}" endpoint "${ENDPOINT}" allowed-ips "${ALLOWED_IPS}" preshared-key "${PSK}" advanced-security "${ADVANCED_SECURITY}"
exit $?
awg set "${INTERFACE_NAME}" peer "${PUBLIC_KEY}" allowed-ips "${ALLOWED_IPS}" endpoint "${ENDPOINT}" allowed-ips "${ALLOWED_IPS}" preshared-key "${PSK_FILE}" advanced-security "${ADVANCED_SECURITY}"
EXIT_CODE=$?

rm -f "{$PSK_FILE}"
exit ${EXIT_CODE}

0 comments on commit 7abb24c

Please sign in to comment.