Skip to content
This repository has been archived by the owner on Aug 11, 2023. It is now read-only.

Add argument for alternative config file #53

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions sbupdate
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ set -eu

shopt -s extglob

readonly CONFFILE="/etc/sbupdate.conf"
CONFFILE="/etc/sbupdate.conf"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As this becomes a command-line option, it should be moved to parse_args.


# Print an error and return unsuccessfully
# $1: error message
Expand Down Expand Up @@ -63,10 +63,11 @@ function parse_args() {
HOOK=0
REMOVE=0

while getopts "kr" opt; do
while getopts "krc:" opt; do
case "${opt}" in
k) HOOK=1 ;;
r) REMOVE=1 ;;
c) CONFFILE=${OPTARG} ;;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

${OPTARG} should be quoted.

?) exit 1 ;;
esac
done
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CONFFILE should be made readonly again below this line.

Expand Down Expand Up @@ -205,8 +206,8 @@ function check_sign_extra_file() {

# Entry point
function main() {
load_config
parse_args "$@"
load_config

find_efi_stub
get_kernels
Expand Down