blob: b9ea1127cef89ba8186ef169c62564a357763588 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
#!/bin/sh
bitWiseAnd() {
local IFS='&'
printf "%s\n" "$(( $* ))"
}
ACBOOT="False"
while IFS=' ' read -ra OPTIONS; do
for i in "${OPTIONS[@]}"; do
while IFS='=' read option param; do
if [ "resetreason" == "$option" ]; then
if [ $(bitWiseAnd "$param" "0x1") -ne 0 ]; then
ACBOOT="True"
fi
fi
done <<< $i
done
done < /proc/cmdline
busctl set-property xyz.openbmc_project.Settings /xyz/openbmc_project/control/host0/ac_boot xyz.openbmc_project.Common.ACBoot ACBoot s "$ACBOOT"
|