File: chkboot-update

package info (click to toggle)
chkboot 1.3-8.2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 288 kB
  • sloc: sh: 267; makefile: 31
file content (24 lines) | stat: -rwxr-xr-x 723 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/usr/bin/env bash
# Post kernel hook that clear valid modification with chkboot -u
# Author: Baptiste BEAUPLAT <lynode@cilg.org>
# license: GPLv2

TRIGGER="/var/lib/chkboot/needs-update"

# Only run if needed
[[ -f "${TRIGGER}" ]] || exit 0
rm -f "${TRIGGER}"

echo "Updating chkboot hashes of your boot files..."

# TEST TO SEE IF BOOT FILES WERE MODIFIED WITHOUT THE USER'S ACKNOWLEDGEMENT (BY
# RUNNING 'chkboot') AND ALERT THEM IF IT HAS BEEN
chkboot-check
if [ "$?" = 1 ]; then
    echo -e "\n### WARNING: Previously modified files were not acknowledged ###"
    echo "### Check the issues log at ${CHANGES_LOG} for details ###"
fi

# RUN CHKBOOT TO UPDATE THE HASHES WITHOUT CREATING THE ALERT FILE
chkboot -u
sync