初始提交

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

21
py-deploy/bin/mscp Normal file
View File

@@ -0,0 +1,21 @@
#!/bin/sh
BASEDIR=$(cd $(dirname "${BASH_SOURCE[0]}")/.. && pwd)
SSH_KEY=${BASEDIR}/$(ls ${BASEDIR} | egrep '.pem$' | head -n 1)
if [ $# -ne 2 ]; then
echo "Copy file to all hosts"
echo "Usage: $0 <source> <target>"
exit 1
fi
for host in $(cat ${BASEDIR}/hosts | grep -v "^#" | awk '{print $1}')
do
if ifconfig | grep inet | grep "${host}" >/dev/null ; then
# skip current host
continue
fi
#scp -i ${SSH_KEY} -r $1 ${host}:$2
scp -r $1 ${host}:$2
done