🗃️ Committing everything that changed 🗃️

This commit is contained in:
casjay 2023-03-16 01:04:40 -04:00
parent f1472e73a9
commit 3563933e2e
No known key found for this signature in database
GPG Key ID: 4F765975C1F0EE5F
2 changed files with 6 additions and 5 deletions

View File

@ -194,7 +194,7 @@ if [ -n "$DEFAULT_TEMPLATE_DIR" ]; then
create_template_name="$(basename "$create_config_template")" create_template_name="$(basename "$create_config_template")"
if [ -d "$create_config_template" ]; then if [ -d "$create_config_template" ]; then
mkdir -p "/config/$create_template_name/" mkdir -p "/config/$create_template_name/"
[ -e "/config/$create_template_name" ] || cp -Rf "$create_config_template/." "/config/$create_template_name/" 2>/dev/null __is_dir_empty "/config/$create_template_name" || cp -Rf "$create_config_template/." "/config/$create_template_name/" 2>/dev/null
elif [ -e "$create_config_template" ]; then elif [ -e "$create_config_template" ]; then
[ -e "/config/$create_template_name" ] || cp -Rf "$create_config_template" "/config/$create_template_name" 2>/dev/null [ -e "/config/$create_template_name" ] || cp -Rf "$create_config_template" "/config/$create_template_name" 2>/dev/null
fi fi
@ -213,7 +213,7 @@ if [ -n "$DEFAULT_CONF_DIR" ]; then
if [ -n "$create_config_template" ]; then if [ -n "$create_config_template" ]; then
if [ -d "$create_config_template" ]; then if [ -d "$create_config_template" ]; then
mkdir -p "/config/$create_config_name" mkdir -p "/config/$create_config_name"
[ -e "/config/$create_config_name" ] || cp -Rf "$create_config_template/." "/config/$create_config_name/" 2>/dev/null __is_dir_empty "/config/$create_config_name" || cp -Rf "$create_config_template/." "/config/$create_config_name/" 2>/dev/null
elif [ -e "$create_config_template" ]; then elif [ -e "$create_config_template" ]; then
[ -e "/config/$create_config_name" ] || cp -Rf "$create_config_template" "/config/$create_config_name" 2>/dev/null [ -e "/config/$create_config_name" ] || cp -Rf "$create_config_template" "/config/$create_config_name" 2>/dev/null
fi fi
@ -232,7 +232,7 @@ if [ -d "/data" ]; then
if [ -n "$create_data_template" ]; then if [ -n "$create_data_template" ]; then
if [ -d "$create_data_template" ]; then if [ -d "$create_data_template" ]; then
mkdir -p "/data/$create_data_name" mkdir -p "/data/$create_data_name"
[ -e "/data/$create_data_name" ] || cp -Rf "$create_data_template/." "/data/$create_data_name/" 2>/dev/null __is_dir_empty "/data/$create_data_name" || cp -Rf "$create_data_template/." "/data/$create_data_name/" 2>/dev/null
elif [ -e "$create_data_template" ]; then elif [ -e "$create_data_template" ]; then
[ -e "/data/$create_data_name" ] || cp -Rf "$create_data_template" "/data/$create_data_name" 2>/dev/null [ -e "/data/$create_data_name" ] || cp -Rf "$create_data_template" "/data/$create_data_name" 2>/dev/null
fi fi
@ -264,14 +264,14 @@ fi
# Copy html files # Copy html files
if [ "$DATA_DIR_INITIALIZED" = "false" ] && [ -n "$WWW_ROOT_DIR" ]; then if [ "$DATA_DIR_INITIALIZED" = "false" ] && [ -n "$WWW_ROOT_DIR" ]; then
if [ -d "$DEFAULT_DATA_DIR/data/htdocs" ]; then if [ -d "$DEFAULT_DATA_DIR/data/htdocs" ]; then
[ "$(ls -A "$WWW_ROOT_DIR/" 2>/dev/null | wc -l)" -ne 0 ] || cp -Rf "$DEFAULT_DATA_DIR/data/htdocs/." "$WWW_ROOT_DIR/" 2>/dev/null __is_dir_empty "$WWW_ROOT_DIR/" || cp -Rf "$DEFAULT_DATA_DIR/data/htdocs/." "$WWW_ROOT_DIR/" 2>/dev/null
fi fi
fi fi
if [ -n "$WWW_ROOT_DIR" ]; then if [ -n "$WWW_ROOT_DIR" ]; then
if [ -d "$DEFAULT_DATA_DIR/htdocs/www" ] && [ ! -d "$WWW_ROOT_DIR" ]; then if [ -d "$DEFAULT_DATA_DIR/htdocs/www" ] && [ ! -d "$WWW_ROOT_DIR" ]; then
mkdir -p "$WWW_ROOT_DIR" mkdir -p "$WWW_ROOT_DIR"
cp -Rf "$DEFAULT_DATA_DIR/htdocs/www/" "$WWW_ROOT_DIR" cp -Rf "$DEFAULT_DATA_DIR/htdocs/www/" "$WWW_ROOT_DIR"
[ -f "$WWW_ROOT_DIR/htdocs/www/server-health" ] || echo "OK" >"$WWW_ROOT_DIR/htdocs/www/server-health" [ -f "$WWW_ROOT_DIR/htdocs/www/health/index.txt" ] || echo "OK" >"$WWW_ROOT_DIR/htdocs/www/health/index.txt"
fi fi
fi fi
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

View File

@ -5,6 +5,7 @@
__rm() { [ -f "$1" ] && rm -Rf "${1:?}"; } __rm() { [ -f "$1" ] && rm -Rf "${1:?}"; }
__cd() { [ -d "$1" ] && builtin cd "$1" || return 1; } __cd() { [ -d "$1" ] && builtin cd "$1" || return 1; }
__netstat() { [ -f "$(type -P netstat)" ] && netstat "$@" || return 10; } __netstat() { [ -f "$(type -P netstat)" ] && netstat "$@" || return 10; }
__is_dir_empty() { [ "$(ls -A "$1" 2>/dev/null | wc -l)" -ne 0 ] || return 1; }
__curl() { curl -q -sfI --max-time 3 -k -o /dev/null "$@" &>/dev/null || return 10; } __curl() { curl -q -sfI --max-time 3 -k -o /dev/null "$@" &>/dev/null || return 10; }
__find() { find "$1" -mindepth 1 -type ${2:-f,d} 2>/dev/null | grep '^' || return 10; } __find() { find "$1" -mindepth 1 -type ${2:-f,d} 2>/dev/null | grep '^' || return 10; }
__no_exit() { exec /bin/sh -c "trap : TERM INT; (while true; do tail -qf /data/logs/entrypoint.log /data/logs/*/*log 2>/dev/null||sleep 20; done) & wait"; } __no_exit() { exec /bin/sh -c "trap : TERM INT; (while true; do tail -qf /data/logs/entrypoint.log /data/logs/*/*log 2>/dev/null||sleep 20; done) & wait"; }