Use mc-image-helper for checking autopause interface (#1952)

This commit is contained in:
Geoff Bourne authored and GitHub committed 2023-02-04 20:53:46 -06:00
1 parent 822bf929c9
commit b8a7bf5a1d
3 files changed
+3 -7

No files matched your search

+1 -1
View File
@@ -46,7 +46,7 @@ RUN easy-add --var os=${TARGETOS} --var arch=${TARGETARCH}${TARGETVARIANT} \
--var version=0.1.1 --var app=maven-metadata-release --file {{.app}} \ --var version=0.1.1 --var app=maven-metadata-release --file {{.app}} \
--from https://github.com/itzg/{{.app}}/releases/download/{{.version}}/{{.app}}_{{.version}}_{{.os}}_{{.arch}}.tar.gz --from https://github.com/itzg/{{.app}}/releases/download/{{.version}}/{{.app}}_{{.version}}_{{.os}}_{{.arch}}.tar.gz
ARG MC_HELPER_VERSION=1.24.23 ARG MC_HELPER_VERSION=1.25.0
ARG MC_HELPER_BASE_URL=https://github.com/itzg/mc-image-helper/releases/download/${MC_HELPER_VERSION} ARG MC_HELPER_BASE_URL=https://github.com/itzg/mc-image-helper/releases/download/${MC_HELPER_VERSION}
RUN curl -fsSL ${MC_HELPER_BASE_URL}/mc-image-helper-${MC_HELPER_VERSION}.tgz \ RUN curl -fsSL ${MC_HELPER_BASE_URL}/mc-image-helper-${MC_HELPER_VERSION}.tgz \
| tar -C /usr/share -zxf - \ | tar -C /usr/share -zxf - \
+2 -2
View File
@@ -10,7 +10,7 @@ fi
autopause_error_loop() { autopause_error_loop() {
logAutopause "Available interfaces within the docker container:" logAutopause "Available interfaces within the docker container:"
logAutopause " $(available_interfaces)" logAutopause " $(mc-image-helper network-interfaces)"
logAutopause "Please set the environment variable AUTOPAUSE_KNOCK_INTERFACE to the interface that handles incoming connections." logAutopause "Please set the environment variable AUTOPAUSE_KNOCK_INTERFACE to the interface that handles incoming connections."
logAutopause "If unsure which interface to choose, run the ifconfig command in the container." logAutopause "If unsure which interface to choose, run the ifconfig command in the container."
logAutopause "Autopause failed to initialize. This log entry will be printed every 30 minutes." logAutopause "Autopause failed to initialize. This log entry will be printed every 30 minutes."
@@ -35,7 +35,7 @@ if [[ -z "$AUTOPAUSE_KNOCK_INTERFACE" ]] ; then
logAutopause "AUTOPAUSE_KNOCK_INTERFACE variable must not be empty!" logAutopause "AUTOPAUSE_KNOCK_INTERFACE variable must not be empty!"
autopause_error_loop autopause_error_loop
fi fi
if ! available_interfaces | grep -q "$AUTOPAUSE_KNOCK_INTERFACE" ; then if ! mc-image-helper network-interfaces --check="$AUTOPAUSE_KNOCK_INTERFACE" ; then
logAutopause "Selected interface \"$AUTOPAUSE_KNOCK_INTERFACE\" does not exist!" logAutopause "Selected interface \"$AUTOPAUSE_KNOCK_INTERFACE\" does not exist!"
autopause_error_loop autopause_error_loop
fi fi
-4
View File
@@ -35,7 +35,3 @@ java_clients_connections() {
java_clients_connected() { java_clients_connected() {
(( $(java_clients_connections) > 0 )) (( $(java_clients_connections) > 0 ))
} }
available_interfaces() {
ifconfig -s | tail +2 | cut -f1 -d ' '
}