19-define-os-ip #24

Merged
hygienic-books merged 23 commits from 19-define-os-ip into main 2023-11-12 03:26:37 +00:00
Showing only changes of commit d5e219dbf5 - Show all commits

View File

@ -36,6 +36,17 @@ trap '[ "$?" -ne 77 ] || exit 77' ERR
declare zpool_drive efi_drive boot_drive part_schema declare zpool_drive efi_drive boot_drive part_schema
function calculate_prefix_from_netmask () {
# https://stackoverflow.com/a/50419919
c='0'
x='0'"$(printf -- '%o' ${1//./ })"
while [ "${x}" -gt '0' ]; do
# Modulo then bitwise-shift x and store as new x
let c+="$(( x % 2 ))" 'x>>=1'
done
printf -- '%s' '/'"${c}";
}
function setup_env_vars () { function setup_env_vars () {
printf -- '%s\n' \ printf -- '%s\n' \
'We will go over a series of questions to create an answer file with' \ 'We will go over a series of questions to create an answer file with' \