#!/bin/bash set -o pipefail cd /opt/autopeer NOTIFY_TO="$(python3 -c 'import config; print(config.NOTIFY_TO)')" user="$1" if [ "$1" = "new" ]; then type="$2" key="$3" connection="$4" if user="$(grep -l -s -r -P '^\s*auth:\s*\Q'"$type"'\E\s+\Q'"$key"'\E$' /opt/autopeer/dn42-registry/data/mntner/ | perl -ne 's@^.*/@@; s@-MNT$@@; print lc;' | head -1)"; then perl -ne 'print if s@^\s*auth:\s*ssh-@restrict,pty ssh-@'