-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathswitch_node.sh
More file actions
executable file
·47 lines (41 loc) · 990 Bytes
/
switch_node.sh
File metadata and controls
executable file
·47 lines (41 loc) · 990 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/bin/bash
docker=snode043
function usage {
echo
echo "Usage:"
echo " bash $0 [options]"
echo "Description:"
echo " the script is used to switch node."
echo " -w/--wsl -- switch to windows subsystem for linux."
echo " -s/--snode -- switch to snode011."
echo " -d/--docker node -- switch to node of docker queue, [default: '$docker']."
echo " -h/--help -- show help message."
echo
exit 0
}
if [ $# -ne 1 ];then
usage
fi
ARG=$(getopt -q -o hwsd: --long help,wsl,snode,docker: -n $0 -- $@)
eval set -- $ARG
while [ -n "$1" ];do
case "$1" in
-d|--docker)
docker=$2;shift 2;;
-w|--wsl)
wsl=true;shift 1;;
-s|--snode)
snode=true;shift 1;;
-h|--help)
help=true;shift 1;;
*)
break;;
esac
done
if [[ $wsl == 'true' ]];then
/usr/bin/ssh chenyl@10.10.155.108
elif [[ $snode == 'true' ]];then
/usr/bin/ssh chenyulong@10.42.1.64
else
ssh $docker -q docker.q
fi