File: touch-reboot-required

package info (click to toggle)
linux-base 4.14
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 260 kB
  • sloc: perl: 518; sh: 13; makefile: 10
file content (16 lines) | stat: -rwxr-xr-x 414 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/bin/sh
# SPDX-License-Identifier: GPL-2.0
# Copyright 2025 Salvatore Bonaccorso <carnil@debian.org>

set -e

if [ -d /run ]; then
    touch /run/reboot-required
    if [ -n "${DPKG_MAINTSCRIPT_PACKAGE}" ]; then
        if ! grep -q "^$DPKG_MAINTSCRIPT_PACKAGE$" /run/reboot-required.pkgs 2> /dev/null ; then
            echo "$DPKG_MAINTSCRIPT_PACKAGE" >> /run/reboot-required.pkgs
        fi
    fi
fi

exit 0