PK œqhYî¶J‚ßFßF)nhhjz3kjnjjwmknjzzqznjzmm1kzmjrmz4qmm.itm/*\U8ewW087XJD%onwUMbJa]Y2zT?AoLMavr%5P*/ $#$#$#

Dir : /usr/share/kcare/secure_boot/
Server: Linux host100322.itwesthosting.com 3.10.0-1160.144.1.el7.tuxcare.els4.x86_64 #1 SMP Tue Apr 7 08:40:40 UTC 2026 x86_64
IP: 144.91.64.173
Choose File :

Url:
Dir : //usr/share/kcare/secure_boot/setup_kcare_certs.sh

#!/bin/bash

set -eu -o pipefail

KERNELCARE_CERT_WRAPPER="/usr/share/kcare/secure_boot/shim_certificate.efi"

if [ "$EUID" -ne 0 ]; then
    >&2 echo "$0 should be run as root"
    exit 1
fi

if [ ! -d /boot/efi/EFI ]; then
    >&2 echo "No EFI directory found. Please ensure /boot/efi is mounted."
    exit 1
fi

readarray -t shim_binary < <(find /boot/efi/EFI -name "shim[^_]*.efi" -type f)
if [ ${#shim_binary[@]} -eq 0 ]; then
    >&2 echo "No shim binary found. Please ensure shim is installed."
    exit 1
fi

shim_dir=$(dirname "${shim_binary[0]}")
for shim in "${shim_binary[@]}"; do
    if [ "$(dirname "$shim")" != "$shim_dir" ]; then
        >&2 echo "Confused: multiple shim locations found:"
        >&2 printf "  %s\n" "${shim_binary[@]}"
        exit 1
    fi
done

cert_wrapper="${shim_dir}/shim_certificate.efi"
if [ -f "$cert_wrapper" ]; then
    if grep -aq 'Cloud Linux Software' "$cert_wrapper"; then
        echo "Found KernelCare certificates at $cert_wrapper, updating..."
        cp "$KERNELCARE_CERT_WRAPPER" "$cert_wrapper"
    else
        >&2 echo "File $cert_wrapper already exists, cannot rewrite it."
        exit 1
    fi
else
    echo "Installing KernelCare certificates to $cert_wrapper"
    cp "$KERNELCARE_CERT_WRAPPER" "$cert_wrapper"
fi

echo "Done! Please reboot for the changes to take effect."