Add check for /boot/cmdline.txt (#206)
* add check /boot/cmdline.txt * fix spacing
This commit is contained in:
parent
d9256b3d81
commit
b45f5cd627
1 changed files with 19 additions and 7 deletions
|
@ -134,14 +134,26 @@ info "Installing the 'ha' cli"
|
||||||
chmod a+x "${PREFIX}/bin/ha"
|
chmod a+x "${PREFIX}/bin/ha"
|
||||||
|
|
||||||
# Switch to cgroup v1
|
# Switch to cgroup v1
|
||||||
if ! grep -q "systemd.unified_cgroup_hierarchy=false" /etc/default/grub; then
|
if [ -f /etc/default/grub ]
|
||||||
|
then
|
||||||
|
if ! grep -q "systemd.unified_cgroup_hierarchy=false" /etc/default/grub; then
|
||||||
info "Switching to cgroup v1"
|
info "Switching to cgroup v1"
|
||||||
cp /etc/default/grub /etc/default/grub.bak
|
cp /etc/default/grub /etc/default/grub.bak
|
||||||
sed -i 's/^GRUB_CMDLINE_LINUX_DEFAULT="/&systemd.unified_cgroup_hierarchy=false /' /etc/default/grub
|
sed -i 's/^GRUB_CMDLINE_LINUX_DEFAULT="/&systemd.unified_cgroup_hierarchy=false /' /etc/default/grub
|
||||||
update-grub
|
update-grub
|
||||||
touch /var/run/reboot-required
|
touch /var/run/reboot-required
|
||||||
|
fi
|
||||||
|
elif [ -f /boot/cmdline.txt ]
|
||||||
|
then
|
||||||
|
if ! grep -q "systemd.unified_cgroup_hierarchy=false" /boot/cmdline.txt; then
|
||||||
|
info "Switching to cgroup v1"
|
||||||
|
cp /boot/cmdline.txt /boot/cmdline.txt.bak
|
||||||
|
sed -i 's/$/ systemd.unified_cgroup_hierarchy=false/' /boot/cmdline.txt
|
||||||
|
touch /var/run/reboot-required
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
warn "Could not find /etc/default/grub or /boot/cmdline.txt failed to switch to cgroup v1"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
info "Within a few minutes you will be able to reach Home Assistant at:"
|
info "Within a few minutes you will be able to reach Home Assistant at:"
|
||||||
info "http://homeassistant.local:8123 or using the IP address of your"
|
info "http://homeassistant.local:8123 or using the IP address of your"
|
||||||
info "machine: http://${IP_ADDRESS}:8123"
|
info "machine: http://${IP_ADDRESS}:8123"
|
||||||
|
|
Loading…
Reference in a new issue