Skip to content

Commit

Permalink
Merge pull request #160 from jumpserver/dev
Browse files Browse the repository at this point in the history
v2.14.0 rc3
  • Loading branch information
BaiJiangJie authored Sep 15, 2021
2 parents 3348dff + 256725c commit e0feed4
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 10 deletions.
8 changes: 7 additions & 1 deletion quick_start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,13 @@ function get_installer() {

function config_installer() {
cd /opt/jumpserver-installer-${Version} || exit 1
sed -i "s/VERSION=.*/VERSION=${Version}/g" /opt/jumpserver-installer-${Version}/static.env
shopt -s expand_aliases
if [[ $(uname) == 'Darwin' ]]; then
alias sedi='sed -i ""'
else
alias sedi='sed -i'
fi
sedi "s/VERSION=.*/VERSION=${Version}/g" /opt/jumpserver-installer-${Version}/static.env
./jmsctl.sh install
./jmsctl.sh start
}
Expand Down
2 changes: 1 addition & 1 deletion scripts/0_prepare.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ USE_XPACK="${USE_XPACK-0}"

function prepare_config_xpack() {
if [[ "${USE_XPACK}" == "1" ]]; then
sed -i 's@USE_XPACK=.*@USE_XPACK=1@g' "${PROJECT_DIR}"/config-example.txt
sedi 's@USE_XPACK=.*@USE_XPACK=1@g' "${PROJECT_DIR}"/config-example.txt
fi
}

Expand Down
4 changes: 2 additions & 2 deletions scripts/7_upgrade.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ function upgrade_config() {
set_config CURRENT_VERSION "${VERSION}"
fi
if grep -q "server nginx" "${CONFIG_DIR}/nginx/lb_http_server.conf"; then
sed -i "s/server nginx/server web/g" "${CONFIG_DIR}/nginx/lb_http_server.conf"
sedi "s/server nginx/server web/g" "${CONFIG_DIR}/nginx/lb_http_server.conf"
fi
}

Expand Down Expand Up @@ -153,7 +153,7 @@ function main() {
fi

if [[ "${to_version}" && "${to_version}" != "${VERSION}" ]]; then
sed -i "s@VERSION=.*@VERSION=${to_version}@g" "${PROJECT_DIR}/static.env"
sedi "s@VERSION=.*@VERSION=${to_version}@g" "${PROJECT_DIR}/static.env"
export VERSION=${to_version}
fi
echo
Expand Down
16 changes: 10 additions & 6 deletions scripts/utils.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
#!/usr/bin/env bash
#

BASE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)"

. "${BASE_DIR}/const.sh"

shopt -s expand_aliases
if [[ $(uname) == 'Darwin' ]]; then
alias sedi='sed -i ""'
else
alias sedi='sed -i'
fi

function is_confirm() {
read -r confirmed
if [[ "${confirmed}" == "y" || "${confirmed}" == "Y" || ${confirmed} == "" ]]; then
Expand Down Expand Up @@ -89,11 +97,7 @@ function set_config() {
return
fi

if [[ "${OS}" == 'Darwin' ]]; then
sed -i '' "s,^${key}=.*$,${key}=${value},g" "${CONFIG_FILE}"
else
sed -i "s,^${key}=.*$,${key}=${value},g" "${CONFIG_FILE}"
fi
sedi "s,^${key}=.*$,${key}=${value},g" "${CONFIG_FILE}"
}

function test_mysql_connect() {
Expand Down Expand Up @@ -428,7 +432,7 @@ function prepare_config() {
echo_done

if [[ "$(uname -m)" == "aarch64" ]]; then
sed -i "s/# ignore-warnings ARM64-COW-BUG/ignore-warnings ARM64-COW-BUG/g" "${CONFIG_DIR}/redis/redis.conf"
sedi "s/# ignore-warnings ARM64-COW-BUG/ignore-warnings ARM64-COW-BUG/g" "${CONFIG_DIR}/redis/redis.conf"
fi

backup_dir="${CONFIG_DIR}/backup"
Expand Down

0 comments on commit e0feed4

Please sign in to comment.