适配小型化升级脚本
This commit is contained in:
parent
3871359928
commit
d0d639699b
|
@ -386,25 +386,21 @@ function check_pkg() {
|
||||||
kernel="EULER"
|
kernel="EULER"
|
||||||
fi
|
fi
|
||||||
elif [[ -f "/etc/openEuler-release" ]]; then
|
elif [[ -f "/etc/openEuler-release" ]]; then
|
||||||
kernel=$(cat /etc/openEuler-release | awk -F ' ' '{print $1}' | tr a-z A-Z)
|
kernel=$(cat /etc/openEuler-release | awk -F ' ' '{print $1}')
|
||||||
elif [[ -f "/etc/centos-release" ]]; then
|
elif [[ -f "/etc/centos-release" ]]; then
|
||||||
kernel=$(cat /etc/centos-release | awk -F ' ' '{print $1}' | tr a-z A-Z)
|
kernel=$(cat /etc/centos-release | awk -F ' ' '{print $1}')
|
||||||
else
|
else
|
||||||
kernel=$(lsb_release -d | awk -F ' ' '{print $2}' | tr a-z A-Z)
|
kernel=$(lsb_release -d | awk -F ' ' '{print $2}')
|
||||||
fi
|
fi
|
||||||
log "kernel: ${kernel}"
|
log "kernel: ${kernel}"
|
||||||
|
|
||||||
#detect platform information.
|
#detect platform information.
|
||||||
platform=32
|
platform_arch=$(uname -p)
|
||||||
bit=$(getconf LONG_BIT)
|
bin_name="openGauss-Lite.*-${kernel}-${platform_arch}"
|
||||||
if [[ "$bit" -eq 64 ]]; then
|
|
||||||
platform=64
|
|
||||||
fi
|
|
||||||
binname="GaussDB-Kernel-.*-${platform}bit"
|
|
||||||
binfile=$(ls -a | grep -E "${binname}.bin")
|
binfile=$(ls -a | grep -E "${binname}.bin")
|
||||||
shafile=${binfile%.*}.sha256
|
shafile=${binfile%.*}.sha256
|
||||||
if [[ ! -f "${binfile}" ]] || [[ ! -f "${shafile}" ]]; then
|
if [[ ! -f "${binfile}" ]] || [[ ! -f "${shafile}" ]]; then
|
||||||
die "bin or sha256 file not exit for the platform ${kernel}-${platform}bit!" ${err_upgrade_pre}
|
die "bin or sha256 file not exit for the platform ${kernel}-${platform_arch}!" ${err_upgrade_pre}
|
||||||
fi
|
fi
|
||||||
sha_expect=$(cat ${shafile})
|
sha_expect=$(cat ${shafile})
|
||||||
sha_current=$(sha256sum ${binfile} | awk '{print $1}')
|
sha_current=$(sha256sum ${binfile} | awk '{print $1}')
|
||||||
|
@ -461,8 +457,8 @@ function decompress_pkg() {
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if cp "$binfile" "$GAUSS_TMP_PATH"/install_bin_"$new_version" && cd "$GAUSS_TMP_PATH"/install_bin_"$new_version" && chmod u+x "$binfile" \
|
if cp "$binfile" "$GAUSS_TMP_PATH"/install_bin_"$new_version" && cd "$GAUSS_TMP_PATH"/install_bin_"$new_version" && tar -zxf "$binfile" \
|
||||||
&& ./"$binfile" > /dev/null && rm -f "$binfile"; then
|
&& rm -f "$binfile"; then
|
||||||
|
|
||||||
log "Decompress $binfile successfully."
|
log "Decompress $binfile successfully."
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in New Issue