lework 5 years ago
parent
commit
694bab211e
  1. 4
      shell/getgcr.sh
  2. 18
      shell/ssh.sh

4
shell/getgcr.sh

@ -18,7 +18,7 @@ ORANGE_PS3=$'\e[0;33m'
WHITE='\033[0;37m' WHITE='\033[0;37m'
proxy=( proxy=(
"gcr.lework.workers.dev" "gcr.lework.workers.dev/google-containers"
"registry.aliyuncs.com/google_containers" "registry.aliyuncs.com/google_containers"
"gcrxio" "gcrxio"
) )
@ -84,7 +84,7 @@ function usage {
echo echo
echo echo
echo "Example:" echo "Example:"
echo " $0 gcr.io/google_containers/pause-amd64:3.1" echo " $0 gcr.io/google-containers/pause-amd64:3.1"
echo " $0 \"k8s.gcr.io/kube-{apiserver,controller-manager,proxy,scheduler}:v1.14.3\"" echo " $0 \"k8s.gcr.io/kube-{apiserver,controller-manager,proxy,scheduler}:v1.14.3\""
echo " $0 -i k8s.gcr.io/pause-amd64:3.1" echo " $0 -i k8s.gcr.io/pause-amd64:3.1"
echo " $0 -p registry.aliyuncs.com/google_containers -i k8s.gcr.io/pause-amd64:3.1" echo " $0 -p registry.aliyuncs.com/google_containers -i k8s.gcr.io/pause-amd64:3.1"

18
shell/ssh.sh

@ -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…
Cancel
Save