@@ -21,6 +21,10 @@ set -ex
21
21
# Main directory we're installing into.
22
22
INSTALLATION_DIR=/data/srv
23
23
24
+ # Default value set for each step flag. Set this to 0 to skip all steps.
25
+ # This helps if you want to only run only a few steps of the installation only.
26
+ EXECUTE_ALL_STEPS=1
27
+
24
28
# This scipt's directory
25
29
SCRIPT_DIR=$( cd -- " $( dirname -- " ${BASH_SOURCE[0]} " ) " & > /dev/null && pwd)
26
30
@@ -555,14 +559,6 @@ declare -a installation_steps=(preliminary_checks
555
559
clean_acrontab
556
560
install_acrontab)
557
561
558
- # Create dynamic flags to selectively disable/enable steps of the installation
559
- # Those flags are named "do_" with the name of the function, e.g. "do_install_yui" for
560
- # the "install_yui" step and "do_check_dependencies" for "check_dependencies".
561
- # We set those flags to 1 by default.
562
- for step in " ${installation_steps[@]} " ; do
563
- eval " do_${step} =1"
564
- done
565
-
566
562
# Parse command line arguments -- use <key>=<value> to override the flags mentioned above.
567
563
# e.g. do_install_yui=0
568
564
for ARGUMENT in " $@ " ; do
@@ -572,6 +568,20 @@ for ARGUMENT in "$@"; do
572
568
eval " $KEY =$VALUE "
573
569
done
574
570
571
+ # Create dynamic flags to selectively disable/enable steps of the installation
572
+ # Those flags are named "do_" with the name of the function, e.g. "do_install_yui" for
573
+ # the "install_yui" step and "do_check_dependencies" for "check_dependencies".
574
+ # We set those flags to the value of EXECUTE_ALL_STEPS by default.
575
+ for step in " ${installation_steps[@]} " ; do
576
+ flag_name=" do_${step} "
577
+ if [ -z " ${! flag_name} " ]; then
578
+ echo " ${flag_name} not defined"
579
+ eval " do_${step} =$EXECUTE_ALL_STEPS "
580
+ else
581
+ echo " ${flag_name} defined and is ${! flag_name} "
582
+ fi
583
+ done
584
+
575
585
# # Internal temporary paths
576
586
ROOT_TMP_DIR=" ${TMP_BASE_PATH} /root"
577
587
ROOT_TMP_BUILD_DIR=" ${TMP_BASE_PATH} /root_build"
0 commit comments