Browse Source

update build_initrd

master
crims0n 5 years ago
parent
commit
8057229652
  1. 31
      build_initrd

31
build_initrd

@ -19,6 +19,8 @@ set -u
# don't change! use ./autoinstall instead # don't change! use ./autoinstall instead
UNATTENDED="0" UNATTENDED="0"
CMD=(build_initrd)
# ============= main ================ # ============= main ================
BUILD_DIR="" BUILD_DIR=""
@ -39,8 +41,33 @@ create_completion
create_backup create_backup
setup_build_dir # check number of args
if [[ $# == 0 || $# > 3 ]]; then help; fi
# loop through args
dash_flag=false
start_index=0
end_index=${#CMD[*]}
for ii in "$@"; do
if [[ $ii == "-" ]]; then
dash_flag=true
continue
fi
find_index $ii
if [[ $dash_flag == false ]]; then
start_index=$index
else
end_index=$(($index + 1))
fi
done
if [[ $dash_flag == false ]]; then
end_index=$(($start_index + 1))
fi
build_initrd #loop through the commands
for ((ii = $start_index; ii < $end_index; ii++)); do
setup_build_dir
${CMD[ii]}
done
echo -e "${BOLD}${LIGHTYELLOW}$0${ENDCOLOUR} - ${LIGHTGREEN}Command completed successfully!${ENDCOLOUR}" echo -e "${BOLD}${LIGHTYELLOW}$0${ENDCOLOUR} - ${LIGHTGREEN}Command completed successfully!${ENDCOLOUR}"

Loading…
Cancel
Save