mirror of
https://github.com/rocky-linux/rocky-tools.git
synced 2024-11-29 00:16:28 +00:00
os-release should be run in a subshell.
os-release should be run in a subshell to avoid the settings corrupting the main script.
This commit is contained in:
parent
7f08a2b696
commit
fdadcac23d
@ -48,13 +48,13 @@ logmessage(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
# This just grabs a field from os-release and returns it.
|
# This just grabs a field from os-release and returns it.
|
||||||
os-release () {
|
os-release () (
|
||||||
. /etc/os-release
|
. /etc/os-release
|
||||||
if ! [[ ${!1} ]]; then
|
if ! [[ ${!1} ]]; then
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
printf '%s\n' "${!1}"
|
printf '%s\n' "${!1}"
|
||||||
}
|
)
|
||||||
|
|
||||||
# All of the binaries used by this script are available in a EL8 minimal install
|
# All of the binaries used by this script are available in a EL8 minimal install
|
||||||
# and are in /bin, so we should not encounter a system where the script doesn't
|
# and are in /bin, so we should not encounter a system where the script doesn't
|
||||||
|
Loading…
Reference in New Issue
Block a user