diff --git a/ct/5etools.sh b/ct/5etools.sh index 8753aa06..c80e0514 100644 --- a/ct/5etools.sh +++ b/ct/5etools.sh @@ -38,7 +38,8 @@ function update_script() { # Crawling the new version and checking whether an update is required RELEASE=$(curl -s https://api.github.com/repos/5etools-mirror-3/5etools-src/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }') - if [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]] || [[ ! -f "/opt/5etools_version.txt" ]]; then + IMG_RELEASE=$(curl -s https://api.github.com/repos/5etools-mirror-2/5etools-img/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }') + if [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]] || [[ "${IMG_RELEASE}" != "$(cat /opt/${APP}_IMG_version.txt)" ]] || [[ ! -f "/opt/5etools_version.txt" ]] || [[ ! -f "/opt/5etools_IMG_version.txt" ]]; then msg_info "Updating $APP to ${RELEASE}" apt-get update &>/dev/null @@ -72,7 +73,9 @@ function update_script() { # Last Action echo "${RELEASE}" >/opt/${APP}_version.txt + echo "${IMG_RELEASE}" >/opt/${APP}_IMG_version.txt msg_ok "Updated $APP to ${RELEASE}" + msg_ok "Updated $APP images to ${IMG_RELEASE}" # Starting httpd msg_info "Starting apache" @@ -91,4 +94,4 @@ description msg_ok "Completed Successfully!\n" echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}" echo -e "${INFO}${YW} Access it using the following URL:${CL}" -echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:80${CL}" \ No newline at end of file +echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:80${CL}" diff --git a/install/5etools-install.sh b/install/5etools-install.sh index 7dab74f0..61e4d3b8 100644 --- a/install/5etools-install.sh +++ b/install/5etools-install.sh @@ -6,7 +6,7 @@ # Source: https://5e.tools/ # Import Functions und Setup -source /dev/stdin <<< "$FUNCTIONS_FILE_PATH" +source /dev/stdin <<<"$FUNCTIONS_FILE_PATH" color verb_ip6 catch_errors @@ -28,24 +28,25 @@ msg_ok "Installed Dependencies" # Setup App msg_info "Setup 5etools" -echo "\n"\ -" SetHandler server-status\n"\ -" Order deny,allow\n"\ -" Allow from all\n"\ -"\n"\ ->> /etc/apache2/apache2.conf +echo "\n""\ + SetHandler server-status\n""\ + Order deny,allow\n""\ + Allow from all\n""\ +\n" \ + >>/etc/apache2/apache2.conf rm -rf /var/www/html RELEASE=$(curl -s https://api.github.com/repos/5etools-mirror-3/5etools-src/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }') +IMG_RELEASE=$(curl -s https://api.github.com/repos/5etools-mirror-2/5etools-img/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }') msg_info "Setting up 5etools" wget -q "https://github.com/5etools-mirror-3/5etools-src/archive/refs/tags/${RELEASE}.zip" -unzip -q "${RELEASE}.zip" -d "/opt/${APP}" +unzip -q "${RELEASE}.zip" -d "/opt/5etools" rm -rf "${RELEASE}.zip" msg_ok "Set up 5etools" msg_info "Setting up 5etools images" -wget -q "https://github.com/5etools-mirror-2/5etools-img/archive/refs/tags/${RELEASE}.zip" -unzip -q "${RELEASE}.zip" -d "/opt/${APP}/img" -rm -rf "${RELEASE}.zip" +wget -q "https://github.com/5etools-mirror-2/5etools-img/archive/refs/tags/${IMG_RELEASE}.zip" +unzip -q "${IMG_RELEASE}.zip" -d "/opt/5etools/img" +rm -rf "${IMG_RELEASE}.zip" msg_info "Set up 5etools images" ln -s "/opt/5etools" /var/www/html