初始提交

This commit is contained in:
2026-03-23 10:33:13 +08:00
commit addf335bc6
15 changed files with 1252 additions and 0 deletions

19
py-deploy/bin/ssh Normal file
View File

@@ -0,0 +1,19 @@
#!/bin/sh
BASEDIR=$(cd $(dirname "${BASH_SOURCE[0]}")/.. && pwd)
SSH_KEY=${BASEDIR}/$(ls ${BASEDIR} | egrep '.pem$' | head -n 1)
if [ $# -lt 1 ]; then
>&2 echo "Usage: $0 <hostname>"
exit 1
fi
host=$1
user=$(whoami)
for h in $(cat ${BASEDIR}/hosts | grep -v "^#" | egrep "\\s+${host}(\\s+.*)*$" | awk '{print $1}')
do
host=${h}
break
done
ssh -i ${SSH_KEY} ${host}