init.sh: Refactor script configuration and directory paths

- Update DIST_BASEDIR assignment to use $DIST_DIR for improved
  clarity and consistency in directory management.
- Rename HTTPD_DIST_HOSTNAME and HTTPD_DIST_DIR to
  UPDATE_SERVER_URL and DIST_DIR respectively, across the script to
  better reflect their purpose and usage.
- Introduce LOCAL_CONFIG_FILE_INC_PATH variable initialization in
  the global scope for enhanced script modularity and maintainability.
- Adjust getopt configuration to align with the renamed and newly
  introduced variables.
This commit is contained in:
2024-03-25 21:30:04 +01:00
parent e5e068c9c6
commit 1c8c28d6fe
2 changed files with 20 additions and 19 deletions

View File

@@ -270,7 +270,6 @@ function create_local_config () {
fi
# modify or upgrade config files inside conf directory
LOCAL_CONFIG_FILE_INC_PATH=$BASEPATH/local.conf.common.inc
if test -f $LOCAL_CONFIG_FILE_INC_PATH; then
if test -f $LOCAL_CONFIG_FILE_PATH; then
@@ -359,7 +358,7 @@ function create_local_config () {
function create_dist_tree () {
# create dist dir
DIST_BASEDIR="$BASEPATH/dist/$IMAGE_VERSION"
DIST_BASEDIR="$DIST_DIR/$IMAGE_VERSION"
if test ! -d "$DIST_BASEDIR"; then
my_echo -e "\033[37;1mcreate dist directory:\033[0m $DIST_BASEDIR"
do_exec "mkdir -p $DIST_BASEDIR"