🗃️ Committing everything that changed 🗃️

This commit is contained in:
casjay 2022-10-25 19:20:06 -04:00
parent df6702dd93
commit 36ddad74fa
No known key found for this signature in database
GPG Key ID: 4F765975C1F0EE5F
2 changed files with 7 additions and 8 deletions

View File

@ -31,9 +31,9 @@ __exec_command() {
return ${exitCode:-$?} return ${exitCode:-$?}
} }
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
__pcheck() { [ -n "$(which pgrep 2>/dev/null)" ] && pgrep -x "$1" || return 1; } __curl() { curl -q -LSsf -o /dev/null "$@" 2>/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; }
__curl() { curl -q -LSsf -o /dev/null -s -w "200" "$@" 2>/dev/null || return 10; } __pcheck() { [ -n "$(which pgrep 2>/dev/null)" ] && pgrep -x "$1" &>/dev/null || return 10; }
__pgrep() { __pcheck "${1:-$SERVICE_NAME}" || ps aux 2>/dev/null | grep -Fw " ${1:-$SERVICE_NAME}" | grep -qv ' grep' || return 10; } __pgrep() { __pcheck "${1:-$SERVICE_NAME}" || ps aux 2>/dev/null | grep -Fw " ${1:-$SERVICE_NAME}" | grep -qv ' grep' || return 10; }
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
__certbot() { __certbot() {
@ -45,7 +45,7 @@ __certbot() {
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
__heath_check() { __heath_check() {
status=0 health="Good" status=0 health="Good"
start-soft.sh healthcheck || status=$((status + 1)) start-soft.sh healthcheck &>/dev/null || status=$((status + 1))
[ "$status" -eq 0 ] || health="Errors reported see docker logs --follow $CONTAINER_NAME" [ "$status" -eq 0 ] || health="Errors reported see docker logs --follow $CONTAINER_NAME"
echo "$(uname -s) $(uname -m) is running and the health is: $health" echo "$(uname -s) $(uname -m) is running and the health is: $health"
return ${status:-$?} return ${status:-$?}

View File

@ -19,9 +19,9 @@
# @@Template : other/start-service # @@Template : other/start-service
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Set functions # Set functions
__pcheck() { [ -n "$(which pgrep 2>/dev/null)" ] && pgrep -x "$1" || return 1; } __curl() { curl -q -LSsf -o /dev/null "$@" 2>/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; }
__curl() { curl -q -LSsf -o /dev/null -s -w "200" "$@" 2>/dev/null || return 10; } __pcheck() { [ -n "$(which pgrep 2>/dev/null)" ] && pgrep -x "$1" &>/dev/null || return 10; }
__pgrep() { __pcheck "$1" || ps aux 2>/dev/null | grep -Fw " $1" | grep -qv ' grep' || return 10; } __pgrep() { __pcheck "$1" || ps aux 2>/dev/null | grep -Fw " $1" | grep -qv ' grep' || return 10; }
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
__certbot() { __certbot() {
@ -33,10 +33,9 @@ __certbot() {
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
__heath_check() { __heath_check() {
status=0 health="Good" status=0 health="Good"
__pgrep ${1:-} || status=$((status + 1)) __pgrep ${1:-} &>/dev/null || status=$((status + 1))
#__curl "http://localhost:$HTTP_PORT/server-health" || status=$((status + 1)) #__curl "http://localhost:$SERVICE_PORT/server-health" || status=$((status + 1))
[ "$status" -eq 0 ] || health="Errors reported see docker logs --follow $CONTAINER_NAME" [ "$status" -eq 0 ] || health="Errors reported see docker logs --follow $CONTAINER_NAME"
echo "$(uname -s) $(uname -m) is running and the health is: $health"
return ${status:-$?} return ${status:-$?}
} }
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -