File tree Expand file tree Collapse file tree 1 file changed +16
-8
lines changed
share/github-backup-utils Expand file tree Collapse file tree 1 file changed +16
-8
lines changed Original file line number Diff line number Diff line change @@ -65,14 +65,22 @@ transfer_size()
65
65
if [[ $cluster_status -eq 0 ]]; then
66
66
cluster_conf_out=$( ghe-ssh " $host " " cat /data/user/common/cluster.conf" )
67
67
cluster_nodes_output=$( ghe-ssh " $host " " ghe-cluster-nodes -i" )
68
- if [[ ( " $1 " == " elasticsearch" || " $1 " == " storage" || " $1 " == " pages" ) ]]; then
69
- host_server=$( echo " $cluster_conf_out " | awk -v srv=" $backup_data -server = true" ' /cluster/ { prevA = $0 } $0 ~ srv { print prevA }' | head -1 | awk -F ' "' ' {print $2}' )
70
- elif [[ " $1 " == " mysql" ]]; then
71
- host_server=$( ghe-ssh " $host " " ghe-config cluster.mysql-master" )
72
- elif [[ " $1 " == " repositories" ]]; then
73
- host_server=$( echo " $cluster_conf_out " | awk ' /git-server = true/ { print prevA } /cluster/ { prevA = $0 }' | head -1 | awk -F ' "' ' {print $2}' )
74
- fi
75
- host=$( echo " $cluster_nodes_output " | grep " $host_server " | awk ' {print $2}' | head -1)
68
+ case $1 in
69
+ elasticsearch | storage | pages)
70
+ cluster_host=$( echo " $cluster_conf_out " | awk -v srv=" $backup_data -server = true" ' /cluster/ { prevA = $0 } $0 ~ srv { print prevA }' | head -1 | awk -F ' "' ' {print $2}' )
71
+ ;;
72
+ mysql)
73
+ cluster_host=$( ghe-ssh " $host " " ghe-config cluster.mysql-master" )
74
+ ;;
75
+ repositories)
76
+ cluster_host=$( echo " $cluster_conf_out " | awk ' /git-server = true/ { print prevA } /cluster/ { prevA = $0 }' | head -1 | awk -F ' "' ' {print $2}' )
77
+ ;;
78
+ * )
79
+ echo " Unknown backup data: $1 "
80
+ exit 1
81
+ ;;
82
+ esac
83
+ host=$( echo " $cluster_nodes_output " | grep " $cluster_host " | awk ' {print $2}' | head -1)
76
84
fi
77
85
78
86
if [ -d " ${GHE_DATA_DIR} /current/$1 " ]; then
You can’t perform that action at this time.
0 commit comments