1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-03-09 15:40:17 +00:00

Quoting vars is safer...on these 3 lines

This commit is contained in:
A Holt 2020-10-27 17:17:40 -04:00 committed by GitHub
parent 1093b117c5
commit d1e53db826
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -28,7 +28,7 @@ SYSTEMD_NETWORKD="none"
source /etc/iiab/iiab.env || true # STAGE var auto-set, so no "if" required.
if tmp=$(grep ^ID= /etc/*elease); then
OS=$(echo $tmp | cut -d= -f2)
OS=$(echo "$tmp" | cut -d= -f2)
OS=${OS//\"/} # Remove all '"'
fi
if [ -f /etc/rpi-issue ]; then
@ -38,7 +38,7 @@ fi
# /etc/lsb-release could also be grep'd. But /etc/upstream-release/lsb-release
# on Linux Mint 20 caused grep of /etc/*elease to fail (on directory not file)
if tmp=$(grep ^VERSION_ID= /etc/os-release); then
VERSION_ID=$(echo $tmp | cut -d= -f2)
VERSION_ID=$(echo "$tmp" | cut -d= -f2)
VERSION_ID=${VERSION_ID//\"/} # Remove all '"'
VERSION_ID=${VERSION_ID%%.*} # Remove all '.' & stuff to the right of em
fi
@ -85,7 +85,7 @@ tmp=$(cat /proc/device-tree/model) &&
RPI_MODEL=$tmp
tmp=$(ansible --version) &&
ANSIBLE_VERSION=$(echo $tmp | head -n 1 | cut -f 2 -d " ")
ANSIBLE_VERSION=$(echo "$tmp" | head -n 1 | cut -f 2 -d " ")
# THESE LAST 3 ARE DIFFEENT as "systemctl is-enabled" unhelpfully returns the