pull image on install, remove it when qpkg is uninstalled

This commit is contained in:
crieke
2026-04-14 05:07:11 +02:00
parent 13082cdb92
commit d4134220a9

View File

@@ -108,18 +108,22 @@ QPKG_NAME="RoonServer"
#PKG_PRE_REMOVE="{ #PKG_PRE_REMOVE="{
#}" #}"
#
#PKG_MAIN_REMOVE="{ PKG_MAIN_REMOVE="{
#}"
# ## Remove Roon Servers docker image
CS_DIR=`$CMD_GETCFG "container-station" Install_Path -f SYS_QPKG_CONFIG_FILE`
$CS_DIR/bin/system-docker image rm 'ghcr.io/roonlabs/roonserver:latest'
}"
PKG_POST_REMOVE="{ PKG_POST_REMOVE="{
## Remove symlink of web interface, if it still exist ## Remove symlink of web interface, if it still exist
RoonSymlink="/home/httpd/cgi-bin/qpkg/RoonServer" RoonSymlink="/home/httpd/cgi-bin/qpkg/RoonServer"
if [ -L $RoonSymlink ]; then if [ -L $RoonSymlink ]; then
"${CMD_RM}" "${RoonSymlink}" "${CMD_RM}" "${RoonSymlink}"
fi fi
}" }"
# #
###################################################################### ######################################################################
@@ -141,24 +145,25 @@ pkg_init(){
# Define any package specific operations that shall be performed when # Define any package specific operations that shall be performed when
# the package is installed. # the package is installed.
###################################################################### ######################################################################
#
pkg_pre_install(){ #pkg_pre_install(){
} #}
pkg_install(){ pkg_install(){
## Creating required folders and setting permissions ## Creating required folders and setting permissions
"${CMD_MKDIR}" -m 777 "${SYS_QPKG_DIR}"/id "${CMD_MKDIR}" -m 777 "${SYS_QPKG_DIR}"/id
CS_DIR=`$CMD_GETCFG "container-station" Install_Path -f SYS_QPKG_CONFIG_FILE`
# Pull Roon Server docker image, so the first qpkg launch will take less time.
$CS_DIR/bin/system-docker pull 'ghcr.io/roonlabs/roonserver:latest'
} }
pkg_post_install(){ pkg_post_install(){
# Checking if required directories exist # Checking if required directories exist
[ -d "${SYS_QPKG_DIR}/tmp" ] || "${CMD_MKDIR}" -m 777 "${SYS_QPKG_DIR}/tmp"
[ -d "${SYS_QPKG_DIR}/id" ] || "${CMD_MKDIR}" -m 777 "${SYS_QPKG_DIR}/id" [ -d "${SYS_QPKG_DIR}/id" ] || "${CMD_MKDIR}" -m 777 "${SYS_QPKG_DIR}/id"
"${CMD_SETCFG}" "${QPKG_NAME}" options "" -f "${SYS_QPKG_CONFIG_FILE}" "${CMD_SETCFG}" "${QPKG_NAME}" options "" -f "${SYS_QPKG_CONFIG_FILE}"
"${CMD_SETCFG}" "${QPKG_NAME}" Force_Visible 1 -f "${SYS_QPKG_CONFIG_FILE}" "${CMD_SETCFG}" "${QPKG_NAME}" Force_Visible 1 -f "${SYS_QPKG_CONFIG_FILE}"
} }