diff --git a/noveriablcgen b/noveriablcgen index 0c24570..6427cbe 100755 --- a/noveriablcgen +++ b/noveriablcgen @@ -81,14 +81,22 @@ for arrval in $(find $bedir -mindepth 1 -maxdepth 1 -type d | grep @root | cut - bootenvs+=("$arrval") done -rm -f "$grubdir/*" +rm -f $grubdir/* for be in ${bootenvs[@]}; do parseTimestampHuman "$be" parseTimestamp "$be" - TIMESTAMP_HUMAN=$(parseTimestampHuman "$be") CURRENT_SUBVOLUME_TIMESTAMP=$(parseTimestamp "$be") ROOT_UUID=$(getValueByKey "root_uuid") envsubst '$TIMESTAMP_HUMAN:$CURRENT_SUBVOLUME_TIMESTAMP:$ROOT_UUID' < "${ROOTPATH}/grub-config.in" >> "${grub_conf_dir}/$(getValueByKey 'filename')" + TIMESTAMP_HUMAN=$(parseTimestampHuman "$be") CURRENT_SUBVOLUME_TIMESTAMP=$(parseTimestamp "$be") ROOT_UUID=$(getValueByKey "root_uuid") envsubst '$TIMESTAMP_HUMAN:$CURRENT_SUBVOLUME_TIMESTAMP:$ROOT_UUID' < "${ROOTPATH}/grub-config.in" >> "${grubdir}/$(getValueByKey 'filename')" done +# Prepend `cat <> "${grubdir}/$(getValueByKey 'filename')" + +grub-mkconfig -o $(getValueByKey 'grub_cfg') + +less $(getValueByKey 'grub_cfg') + ## # SCRIPT END ## \ No newline at end of file diff --git a/noveriablcgen.json b/noveriablcgen.json index aae3599..1bd645a 100644 --- a/noveriablcgen.json +++ b/noveriablcgen.json @@ -2,5 +2,6 @@ "be_env_dir": "/btrfs", "grub_conf_dir": "", "filename": "", - "root_uuid": "" + "root_uuid": "", + "grub_cfg": "" } \ No newline at end of file