This commit is contained in:
Wang Sen Di
2025-12-16 16:21:06 +08:00
parent 2016d198f2
commit e54dcbb7ba

View File

@@ -40,16 +40,16 @@ __kill_process() {
}
__download_goudev_deploy() {
local tmp_path="${_goudev_deploy_host_path}.tmp"
local tmp_path="${CACHE}/${FILE_PATH_START}/${BINARY_NAME}.tmp"
mkdir -p "$HOST_INSTALL_DIR"
mkdir -p "${CACHE}/${FILE_PATH_START}"
if ! curl -sSfLk "$REMOTE_URL" -o "$tmp_path"; then
rm -f "$tmp_path"
return 1
fi
chmod 0755 "$tmp_path"
mv "$tmp_path" "$_goudev_deploy_host_path"
__host_exec chown root:root "${INSTALL_DIR}/${BINARY_NAME}" >/dev/null 2>&1 || true
mv "$tmp_path" "${CACHE}/${FILE_PATH_START}"
__host_exec chown root:root "${CACHE}/${FILE_PATH_START}/${BINARY_NAME}" >/dev/null 2>&1 || true
return 0
}
@@ -58,13 +58,13 @@ __sync_goudev_deploy() {
local remote_md5=""
remote_md5=$(curl -sSfLk "$REMOTE_MD5_URL" 2>/dev/null || true)
if [[ ! -f "$_goudev_deploy_host_path" ]]; then
if [[ ! -f "${CACHE}/${FILE_PATH_START}/${BINARY_NAME}" ]]; then
if __download_goudev_deploy; then
_binary_refreshed=1
fi
elif [[ -n "$remote_md5" ]]; then
local local_md5
local_md5=$(md5sum "$_goudev_deploy_host_path" | awk '{print $1}')
local_md5=$(md5sum "${CACHE}/${FILE_PATH_START}/${BINARY_NAME}" | awk '{print $1}')
if [[ "$remote_md5" != "$local_md5" ]]; then
if __download_goudev_deploy; then
_binary_refreshed=1