mirror of
https://gitlab.archlinux.org/tpowa/archboot.git
synced 2024-09-19 19:40:37 +02:00
replace awk with rg
This commit is contained in:
parent
688fbb1810
commit
82e5b59aef
2 changed files with 3 additions and 3 deletions
|
@ -16,7 +16,7 @@ usage () {
|
||||||
_DIR="${2}"
|
_DIR="${2}"
|
||||||
while [ $# -gt 0 ]; do
|
while [ $# -gt 0 ]; do
|
||||||
case ${1} in
|
case ${1} in
|
||||||
-name=*|--name=*) NAME="$(echo "${1}" | awk -F= '{print $2;}')" ;;
|
-name=*|--name=*) NAME="$(echo "${1}" | rg -o '=(.*)' -r '$1')" ;;
|
||||||
-h|--h|?) usage ;;
|
-h|--h|?) usage ;;
|
||||||
esac
|
esac
|
||||||
shift
|
shift
|
||||||
|
|
|
@ -60,8 +60,8 @@ _set_uefi_parameters() {
|
||||||
[[ -e "/sys/firmware/efi" ]] && _UEFI_BOOT=1
|
[[ -e "/sys/firmware/efi" ]] && _UEFI_BOOT=1
|
||||||
if [[ -n "${_UEFI_BOOT}" ]]; then
|
if [[ -n "${_UEFI_BOOT}" ]]; then
|
||||||
_GUIDPARAMETER=1
|
_GUIDPARAMETER=1
|
||||||
_SECUREBOOT_VAR_VALUE="$(efivar -n 8be4df61-93ca-11d2-aa0d-00e098032b8c-SecureBoot 2>"${_NO_LOG}" | tail -n -1 | awk '{print $2}')"
|
_SECUREBOOT_VAR_VALUE="$(efivar -n 8be4df61-93ca-11d2-aa0d-00e098032b8c-SecureBoot 2>"${_NO_LOG}" | rg -o ' ([0-9]+)' -r '$1')"
|
||||||
_SETUPMODE_VAR_VALUE="$(efivar -n 8be4df61-93ca-11d2-aa0d-00e098032b8c-SetupMode 2>"${_NO_LOG}" | tail -n -1 | awk '{print $2}')"
|
_SETUPMODE_VAR_VALUE="$(efivar -n 8be4df61-93ca-11d2-aa0d-00e098032b8c-SetupMode 2>"${_NO_LOG}" | rg -o ' ([0-9]+)' -r '$1')"
|
||||||
if [[ "${_SECUREBOOT_VAR_VALUE}" == "01" ]] && [[ "${_SETUPMODE_VAR_VALUE}" == "00" ]]; then
|
if [[ "${_SECUREBOOT_VAR_VALUE}" == "01" ]] && [[ "${_SETUPMODE_VAR_VALUE}" == "00" ]]; then
|
||||||
_UEFI_SECURE_BOOT=1
|
_UEFI_SECURE_BOOT=1
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in a new issue