summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xauthorized_keys.sh1
-rwxr-xr-xautopeer_shell.py5
2 files changed, 6 insertions, 0 deletions
diff --git a/authorized_keys.sh b/authorized_keys.sh
index 1ee9f73..f64fc72 100755
--- a/authorized_keys.sh
+++ b/authorized_keys.sh
@@ -10,6 +10,7 @@ if [ "$1" = "new" ]; then
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-@' </opt/autopeer/dn42-registry/data/mntner/"$(echo "$user" | perl -ne 's@$@-MNT@; print uc;')"
/usr/sbin/adduser --disabled-password --quiet --comment "created at $(date +%s) by $key $connection" --ingroup autopeer "$user"
+ /usr/sbin/adduser "$user" bird
fi
else # not new user
perl -ne 'print if s@^\s*auth:\s*ssh-@restrict,pty ssh-@' </opt/autopeer/dn42-registry/data/mntner/"$(echo "$user" | perl -ne 's@$@-MNT@; print uc;')"
diff --git a/autopeer_shell.py b/autopeer_shell.py
index 1939348..3b51c36 100755
--- a/autopeer_shell.py
+++ b/autopeer_shell.py
@@ -194,6 +194,11 @@ Your Tunnel IPv6LL: {you.ipll}
print("No way! Try an AS you're mntner of!", file=sys.stderr)
@parse(0)
+ def do_birdc(self):
+ '''Run birdc'''
+ os.system('/usr/sbin/birdc -r')
+
+ @parse(0)
def do_exit(self):
return True