Skip to content

Commit 54f9b02

Browse files
committed
flatcar-{update,install}: Source version.txt to get flatcar version
It guards against possible quotes.
1 parent 591e7a6 commit 54f9b02

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

bin/flatcar-install

+1-1
Original file line numberDiff line numberDiff line change
@@ -642,7 +642,7 @@ function prep_url(){
642642
# if the version is "current", resolve the actual version number
643643
if [[ "${VERSION_ID}" == "current" ]]; then
644644
local VERSIONTXT_URL="${BASE_URL}/${VERSION_ID}/version.txt"
645-
VERSION_ID=$(wget ${WGET_ARGS} -qO- "${VERSIONTXT_URL}" | sed -n 's/^FLATCAR_VERSION=//p')
645+
VERSION_ID=$(source <(wget ${WGET_ARGS} -qO- "${VERSIONTXT_URL}"); echo "${FLATCAR_VERSION}")
646646
if [[ -z "${VERSION_ID}" ]]; then
647647
echo "$0: version.txt unavailable: ${VERSIONTXT_URL}" >&2
648648
exit 1

bin/flatcar-update

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ while true; do
3838
echo " -M, --listen-port-2 <PORT> Overwrites standard listen port 9091"
3939
echo
4040
echo "Example for updating to the latest Stable release and disabling automatic updates afterwards:"
41-
echo ' VER=$(curl -fsSL https://stable.release.flatcar-linux.net/amd64-usr/current/version.txt | grep FLATCAR_VERSION= | cut -d = -f 2)'
41+
echo ' VER=$(source <(curl -fsSL https://stable.release.flatcar-linux.net/amd64-usr/current/version.txt); echo "${FLATCAR_VERSION}")'
4242
echo " $(basename "${0}") -V \$VER -A"
4343
exit 1
4444
;;

0 commit comments

Comments
 (0)