Skip to content

Commit

Permalink
fix: 修复升级的多次提问问题和redis mysql测试连接问题 (#27)
Browse files Browse the repository at this point in the history
  • Loading branch information
ibuler authored Dec 18, 2020
1 parent 788911c commit 654e6c1
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 14 deletions.
6 changes: 1 addition & 5 deletions jmsctl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -108,11 +108,7 @@ function check_update() {
echo "最新版本是: ${latest_version}"
echo "当前版本是: ${current_version}"
echo
confirm="n"
read_from_input confirm "要更新到这个版本吗?" "y/n" "${confirm}"
if [[ "${confirm}" == "y" ]];then
bash "${SCRIPT_DIR}/7_upgrade.sh" "${latest_version}"
fi
bash "${SCRIPT_DIR}/7_upgrade.sh" "${latest_version}"
}

function main() {
Expand Down
16 changes: 8 additions & 8 deletions scripts/1_config_jumpserver.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ function set_external_mysql() {
mysql_pass=""
read_from_input mysql_pass "请输入mysql的密码" "" "${mysql_pass}"

test_mysql_connect ${mysql_host} ${mysql_port} ${mysql_user} ${mysql_pass} ${mysql_db}
if [[ "$?" != "0" ]]; then
echo "测试连接数据库失败, 可以 Ctrl-C 退出程序重新设置,或者继续"
fi
# test_mysql_connect ${mysql_host} ${mysql_port} ${mysql_user} ${mysql_pass} ${mysql_db}
# if [[ "$?" != "0" ]]; then
# echo "测试连接数据库失败, 可以 Ctrl-C 退出程序重新设置,或者继续"
# fi
set_config DB_HOST ${mysql_host}
set_config DB_PORT ${mysql_port}
set_config DB_USER ${mysql_user}
Expand Down Expand Up @@ -68,10 +68,10 @@ function set_external_redis() {
redis_password=""
read_from_input redis_password "请输入redis的密码" "" "${redis_password}"

test_redis_connect ${redis_host} ${redis_port} ${redis_password}
if [[ "$?" != "0" ]]; then
echo "测试连接Redis失败, 可以 Ctrl-C 退出程序重新设置,或者继续"
fi
# test_redis_connect ${redis_host} ${redis_port} ${redis_password}
# if [[ "$?" != "0" ]]; then
# echo "测试连接Redis失败, 可以 Ctrl-C 退出程序重新设置,或者继续"
# fi
set_config REDIS_HOST ${redis_host}
set_config REDIS_PORT ${redis_port}
set_config REDIS_PASSWORD ${redis_password}
Expand Down
1 change: 0 additions & 1 deletion scripts/7_upgrade.sh
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,5 @@ function main() {
}

if [[ "$0" == "${BASH_SOURCE[0]}" ]]; then
echo_logo
main
fi

0 comments on commit 654e6c1

Please sign in to comment.