Skip to content

Commit 47f720a

Browse files
authored
Merge pull request #30 from macmpi/dev
version 1.2.2
2 parents b0e809b + e3b9423 commit 47f720a

File tree

3 files changed

+13
-11
lines changed

3 files changed

+13
-11
lines changed

headless.apkovl.tar.gz

29 Bytes
Binary file not shown.

headless.apkovl.tar.gz.sha512

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
7ba93d6c47ada0f1ddf89d55be49342df16fec1e2e1ac38a09e82f34248a86f953d9efbac0eeba472e33d03d85f8fe8e65cb88c914fac1268e932cc39e558f4b headless.apkovl.tar.gz
1+
d30ebaec4e1e9224e0a4a34861f392ba41adf585cdf6e3ede41492fb6a55a0c881455a510663422b77cb42a5b48a02fc17d62fafc74df6c49e324639b25ba337 headless.apkovl.tar.gz

overlay/usr/local/bin/headless_bootstrap

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# SPDX-FileCopyrightText: Copyright 2022-2023, macmpi
44
# SPDX-License-Identifier: MIT
55

6-
HDLSBSTRP_VERSION="1.2.1"
6+
HDLSBSTRP_VERSION="1.2.2"
77

88
_apk() {
99
local cmd="$1"
@@ -150,18 +150,20 @@ local file_url="https://is.gd/apkovl_master"
150150
local sha_url="https://github.com/macmpi/alpine-linux-headless-bootstrap/raw/main/headless.apkovl.tar.gz.sha512"
151151
local updt_status="failed, keeping original version"
152152

153-
if wget -q -O /tmp/apkovl -T 10 "$file_url" >/dev/null 2>&1 && \
153+
# Ensure system date is correct to allow SSL transactions
154+
ntpd -N -p pool.ntp.org -n -q
155+
156+
_is_ro && mount -o remount,rw "${ovlpath}"
157+
if wget -q -O "${ovl}_new" -T 10 "$file_url" >/dev/null 2>&1 && \
154158
wget -q -O /tmp/sha -T 10 "$sha_url" >/dev/null 2>&1 && \
155-
[ "$( sha512sum /tmp/apkovl | awk '{print $1}' )" = "$( awk '{print $1}' /tmp/sha )" ]; then
156-
_is_ro && mount -o remount,rw "${ovlpath}"
157-
cp /tmp/apkovl "${ovl}"
158-
_is_ro && mount -o remount,ro "${ovlpath}"
159-
! [ "$( sha512sum "${ovl}" | awk '{print $1}' )" = "$( awk '{print $1}' /tmp/sha )" ] && \
160-
_logger "Bad update: original apkovl file may be altered, please check!..." && return 1
159+
[ "$( sha512sum "${ovl}_new" | awk '{print $1}' )" = "$( awk '{print $1}' /tmp/sha )" ]; then
160+
mv -f "${ovl}_new" "${ovl}"
161161
updt_status="successful"
162162
fi
163-
rm -f /tmp/apkovl /tmp/sha
163+
rm -f "${ovl}_new" /tmp/sha
164+
_is_ro && mount -o remount,ro "${ovlpath}"
164165
_logger "Update $updt_status"
166+
165167
if [ "$updt_status" = "successful" ]; then
166168
printf '%s\n\n' "Updated" >>/tmp/.trash/banner
167169
else
@@ -185,7 +187,7 @@ local vers=""
185187
local ref="/macmpi/alpine-linux-headless-bootstrap/releases/tag/v"
186188
local url="https://is.gd/apkovl_run"
187189

188-
if wget -q -O /tmp/homepg -T 10 "$url" >/dev/null 2>&1; then
190+
if wget -q -O /tmp/homepg -T 10 --no-check-certificate "$url" >/dev/null 2>&1; then
189191
_logger "Internet access: success"
190192
vers="$( grep -o "$ref.*\"" /tmp/homepg | grep -Eo '[0-9]+[\.[0-9]+]*' )"
191193
rm -f /tmp/homepg

0 commit comments

Comments
 (0)