Github bot : script beautyshied

This commit is contained in:
github-actions
2022-11-06 00:16:11 +00:00
parent ee7e035657
commit 15f578aa1d

View File

@@ -2,29 +2,29 @@
if bashio::config.has_value "graphic_driver"; then
# Origin : https://github.com/wumingjieno1/photoprism-test/blob/main/scripts/dist/install-gpu.sh
# abort if not executed as root
if [[ $(id -u) != "0" ]]; then
# Origin : https://github.com/wumingjieno1/photoprism-test/blob/main/scripts/dist/install-gpu.sh
# abort if not executed as root
if [[ $(id -u) != "0" ]]; then
bashio::log.fatal "Error: Run ${0##*/} as root" 1>&2
exit 1
fi
fi
# Get installer type
if [ -f /usr/bin/apt ]; then
# Get installer type
if [ -f /usr/bin/apt ]; then
bashio::log.info "... Distribution detected : Debian/Ubuntu"
elif [ -f /usr/bin/apk ]; then
elif [ -f /usr/bin/apk ]; then
bashio::log.info "... Distribution detected : Alpine"
fi
fi
# Detect GPU
# shellcheck disable=SC2207
GPU_DETECTED=($(lshw -c display -json 2>/dev/null | jq -r '.[].configuration.driver'))
bashio::log.info "... GPU detected: ${GPU_DETECTED[*]}"
graphic_driver=""
# Detect GPU
# shellcheck disable=SC2207
GPU_DETECTED=($(lshw -c display -json 2>/dev/null | jq -r '.[].configuration.driver'))
bashio::log.info "... GPU detected: ${GPU_DETECTED[*]}"
graphic_driver=""
# Get arch type
BUILD_ARCH="$(uname -m)"
case "$BUILD_ARCH" in
# Get arch type
BUILD_ARCH="$(uname -m)"
case "$BUILD_ARCH" in
amd64 | AMD64 | x86_64 | x86-64)
BUILD_ARCH=amd64
;;
@@ -43,11 +43,11 @@ case "$BUILD_ARCH" in
bashio::log.fatal "Unsupported Machine Architecture: $BUILD_ARCH" 1>&2
exit 1
;;
esac
bashio::log.info "... architecture detected: ${BUILD_ARCH}"
esac
bashio::log.info "... architecture detected: ${BUILD_ARCH}"
#graphic_driver="$(bashio::config "graphic_driver")"
case "$graphic_driver" in
#graphic_driver="$(bashio::config "graphic_driver")"
case "$graphic_driver" in
x64_AMD)
if [[ "$BUILD_ARCH" != amd64 ]]; then bashio::log.fatal "Wrong architecture, $graphic_driver doesn't support $BUILD_ARCH"; fi
[ -f /usr/bin/apt ] && DOCKER_MODS=linuxserver/mods:jellyfin-amd && run_mods >/dev/null && bashio::log.green "... done"
@@ -73,10 +73,10 @@ case "$graphic_driver" in
[ -f /usr/bin/apt ] && apt-get -yqq install libgles2-mesa libgles2-mesa-dev xorg-dev >/dev/null && bashio::log.green "... done"
;;
esac
esac
# Main run logic
run_mods() {
# Main run logic
run_mods() {
echo "[mod-init] Attempting to run Docker Modification Logic"
for DOCKER_MOD in $(echo "${DOCKER_MODS}" | tr '|' '\n'); do
# Support alternative endpoints
@@ -161,6 +161,6 @@ run_mods() {
echo "[mod-init] ${DOCKER_MOD} applied to container"
fi
done
}
}
fi