diff --git a/kdumpctl b/kdumpctl index 3ccfa97..bf74c75 100755 --- a/kdumpctl +++ b/kdumpctl @@ -1580,15 +1580,19 @@ reset_crashkernel_after_update() # # The environment variable entries in /proc/[pid]/environ are separated # by null bytes instead of by spaces. +# +# $1: environment variable +# $2: environ file path read_proc_environ_var() { - local _environ_path=$1 _var=$2 + local _var=$1 _environ_path=$2 sed -n -E "s/.*(^|\x00)${_var}=([^\x00]*).*/\2/p" < "$_environ_path" } +_OSBUILD_ENVIRON_PATH='/proc/1/environ' _is_osbuild() { - [[ $(read_proc_environ_var container /proc/1/environ) == bwrap-osbuild ]] + [[ $(read_proc_environ_var container "$_OSBUILD_ENVIRON_PATH") == bwrap-osbuild ]] } reset_crashkernel_for_installed_kernel()