mirror of https://github.com/lework/script
lework
5 years ago
2 changed files with 20 additions and 2 deletions
@ -0,0 +1,18 @@
@@ -0,0 +1,18 @@
|
||||
SSH_PASSWORD="r00tme" |
||||
SSH_USER="root" |
||||
SSH_OPTIONS="-o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" |
||||
|
||||
type sshpass || (echo "sshpass is not installed" && exit 1) |
||||
|
||||
ssh_exec() { |
||||
node=$1 |
||||
shift |
||||
sshpass -p ${SSH_PASSWORD} ssh ${SSH_OPTIONS} ${SSH_USER}@${node} "$@" |
||||
} |
||||
|
||||
scp_exec() { |
||||
node=$1 |
||||
src=$2 |
||||
dst=$3 |
||||
sshpass -p ${SSH_PASSWORD} scp ${SSH_OPTIONS} ${2} ${SSH_USER}@${node}:${3} |
||||
} |
Loading…
Reference in new issue