-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
938efd3
commit ecff079
Showing
3 changed files
with
65 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
#!/bin/bash | ||
##### | ||
# Tries to find existing zfsbootmenu.EFI file and replace this with another one | ||
# Creates a backup of the existing file | ||
#### | ||
# @since: 2023-11-10 | ||
# @author: stev leibelt <[email protected]> | ||
#### | ||
|
||
function _echo_if_be_verbose () | ||
{ | ||
if [[ ${BE_VERBOSE} -eq 1 ]]; | ||
then | ||
echo "${@}" | ||
fi | ||
} | ||
|
||
function _exit_if_last_exit_code_is_not_zero () | ||
{ | ||
local ERROR_MESSAGE | ||
local LAST_COMMAND | ||
local LAST_EXIT_CODE | ||
|
||
ERROR_MESSAGE="${2:-'Something went wrong'}" | ||
LAST_COMMAND="${@:2}" | ||
LAST_EXIT_CODE="${1:-1}" | ||
|
||
if [[ ${LAST_EXIT_CODE} -ne 0 ]]; | ||
then | ||
echo ":: Error" | ||
echo " Last exit code >>${LAST_EXIT_CODE}<<" | ||
echo " Last command >>${LAST_COMMAND}<<" | ||
echo " >>${ERROR_MESSAGE}<<." | ||
|
||
exit "${LAST_EXIT_CODE}" | ||
fi | ||
} | ||
|
||
function _main () | ||
{ | ||
local BASEPATH_OF_THIS_SCRIPT | ||
|
||
BASEPATH_OF_THIS_SCRIPT=$(cd $(dirname "${BASH_SOURCE[0]}"); pwd) | ||
|
||
if [[ ${UID} != 0 ]]; | ||
then | ||
echo ":: Script needs to be executed as root" | ||
|
||
exit 10 | ||
fi | ||
|
||
# ref: https://github.com/archlinux/archinstall?tab=readme-ov-file#running-the-guided-installer-using-git | ||
python -m archinstall | ||
} | ||
|
||
_main "${@}" |