Skip to content

Commit

Permalink
Merge pull request #939 from iranzo/linux16
Browse files Browse the repository at this point in the history
Detect linux16 used in some grub configurations
  • Loading branch information
iranzo authored Aug 5, 2024
2 parents e996f55 + f0aa919 commit ad32579
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions risuclient/plugins/core/informative/linux16.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#!/bin/bash

# Copyright (C) 2023 Pablo Iranzo Gómez <[email protected]>

# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.

# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.

# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.

# long_name: Detects if system is using linux16 and/or initd16 instead of regular descriptions
# description: Reports if system is using linux16 or initrd16
# priority: 100
# kb:

# Load common functions
[[ -f "${RISU_BASE}/common-functions.sh" ]] && . "${RISU_BASE}/common-functions.sh"

MYFILE="${RISU_ROOT}/etc/grub2.cfg"

is_required_file ${MYFILE}

RC=${RC_OKAY}

if is_lineinfile ^linux16.* ${MYFILE}; then
RC=${RC_INFO}
echo "linux16 entry detected in ${MYFILE}" >&2
fi
if is_lineinfile ^initrd16.* ${MYFILE}; then
RC=${RC_INFO}
echo "initrd16 entry detected in ${MYFILE}" >&2
fi
exit ${RC}

0 comments on commit ad32579

Please sign in to comment.