added two scripts to bin/

This commit is contained in:
ahriman 2019-03-26 22:46:26 +00:00
parent 165868747c
commit 38f3b69c07
2 changed files with 26 additions and 0 deletions

15
bin/dcss Executable file
View File

@ -0,0 +1,15 @@
#!/bin/sh
# downloads the ssh private key for
# user dcss@crawl.tildeverse.org
# if it doesn't already exist
# then connects
SOURCEKEY="https://crawl.tildeverse.org/dcss.key"
MYKEY="${HOME}/.ssh/dcss.key"
if [ ! -f "$MYKEY" ]; then
mkdir -p "${HOME}/.ssh"
curl -s "$SOURCEKEY" > "$MYKEY"
chmod 600 "$MYKEY"
fi
ssh -i "$MYKEY" dcss@crawl.tildeverse.org

11
bin/showwhoison Executable file
View File

@ -0,0 +1,11 @@
#!/usr/local/bin/bash
# kneezle@tilde.institute
# Shows connected users, including those
# connected via mosh
x=$(who | cut -d' ' -f1 )
y=$(ps aux | grep mosh | cut -d' ' -f1)
echo "Currently logged in users, including MOSH: "
echo "$x" |sort | uniq
echo "$y" | sort | uniq