You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
74 lines
1.5 KiB
74 lines
1.5 KiB
#!/bin/bash
|
|
|
|
set -e # exit on error
|
|
set -o pipefail # exit on pipeline error
|
|
set -u # treat unset variable as error
|
|
|
|
SCRIPT_DIR="$(dirname "$(readlink -f "$0")")"
|
|
PARENT_DIR="$(dirname "$SCRIPT_DIR")"
|
|
CURRENT_DIR="$(pwd)"
|
|
ISO_DIR=$CURRENT_DIR/iso
|
|
TMP_DIR="/tmp/"
|
|
|
|
if [ -f $SCRIPT_DIR/minioslib ]; then
|
|
. $SCRIPT_DIR/minioslib || exit 1
|
|
else
|
|
. /usr/lib/minioslib || exit 1
|
|
fi
|
|
if [ -f $SCRIPT_DIR/config ]; then
|
|
. $SCRIPT_DIR/config || exit 1
|
|
elif [ -f /etc/minios/config ]; then
|
|
. /etc/minios/config || exit 1
|
|
else
|
|
. /run/initramfs/lib/config || exit 1
|
|
fi
|
|
if [ -f $CURRENT_DIR/config ]; then
|
|
. $CURRENT_DIR/config
|
|
fi
|
|
|
|
# don't change! use ./autoinstall instead
|
|
UNATTENDED="1"
|
|
|
|
CMD=(build_modules repack_system)
|
|
|
|
# ============= main ================
|
|
|
|
BUILD_DIR=""
|
|
|
|
common_variables
|
|
|
|
console_colours
|
|
|
|
allow_root_only
|
|
|
|
create_completion
|
|
|
|
# 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
|
|
|
|
#loop through the commands
|
|
for ((ii = $start_index; ii < $end_index; ii++)); do
|
|
${CMD[ii]}
|
|
done
|
|
|
|
echo -e "${BOLD}${LIGHTYELLOW}$0${ENDCOLOUR} - ${LIGHTGREEN}Command completed successfully!${ENDCOLOUR}"
|
|
|