From a9742f18cdd098dad51c225235af3d9d816c8945 Mon Sep 17 00:00:00 2001 From: tteckster Date: Wed, 10 Apr 2024 06:56:56 -0400 Subject: [PATCH 1/7] Update heimdalldashboard.sh tweak update function --- ct/heimdalldashboard.sh | 79 +++++++++++++++++++++-------------------- 1 file changed, 40 insertions(+), 39 deletions(-) diff --git a/ct/heimdalldashboard.sh b/ct/heimdalldashboard.sh index bdc4889c6..d79ac7061 100644 --- a/ct/heimdalldashboard.sh +++ b/ct/heimdalldashboard.sh @@ -55,49 +55,50 @@ function default_settings() { function update_script() { header_info if [[ ! -d /opt/Heimdall ]]; then msg_error "No ${APP} Installation Found!"; exit; fi -msg_info "Stopping ${APP}" -systemctl stop heimdall -sleep 1 -msg_ok "Stopped ${APP}" - -msg_info "Backing up Data" -cp -R /opt/Heimdall/database database-backup -cp -R /opt/Heimdall/public public-backup -sleep 1 -msg_ok "Backed up Data" - RELEASE=$(curl -sX GET "https://api.github.com/repos/linuxserver/Heimdall/releases/latest" | awk '/tag_name/{print $4;exit}' FS='[""]') -msg_info "Updating Heimdall Dashboard to ${RELEASE}" -wget -q https://github.com/linuxserver/Heimdall/archive/${RELEASE}.tar.gz -tar xzf ${RELEASE}.tar.gz -VER=$(curl -s https://api.github.com/repos/linuxserver/Heimdall/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }') -cp -R Heimdall-${VER}/* /opt/Heimdall -cd /opt/Heimdall -apt-get install -y composer &>/dev/null -COMPOSER_ALLOW_SUPERUSER=1 composer dump-autoload &>/dev/null -msg_ok "Updated Heimdall Dashboard to ${RELEASE}" +if [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]] || [[ ! -f /opt/${APP}_version.txt ]]; then + msg_info "Stopping ${APP}" + systemctl stop heimdall + sleep 1 + msg_ok "Stopped ${APP}" -msg_info "Restoring Data" -cd ~ -cp -R database-backup/* /opt/Heimdall/database -cp -R public-backup/* /opt/Heimdall/public -sleep 1 -msg_ok "Restored Data" + msg_info "Backing up Data" + cp -R /opt/Heimdall/database database-backup + cp -R /opt/Heimdall/public public-backup + sleep 1 + msg_ok "Backed up Data" -msg_info "Cleanup" -rm -rf ${RELEASE}.tar.gz -rm -rf Heimdall-${VER} -rm -rf public-backup -rm -rf database-backup -rm -rf Heimdall -sleep 1 -msg_ok "Cleaned" + msg_info "Updating Heimdall Dashboard to ${RELEASE}" + echo "${RELEASE}" >/opt/${APP}_version.txt + wget -q https://github.com/linuxserver/Heimdall/archive/${RELEASE}.tar.gz + tar xzf ${RELEASE}.tar.gz + VER=$(curl -s https://api.github.com/repos/linuxserver/Heimdall/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }') + cp -R Heimdall-${VER}/* /opt/Heimdall + cd /opt/Heimdall + apt-get install -y composer &>/dev/null + COMPOSER_ALLOW_SUPERUSER=1 composer dump-autoload &>/dev/null + msg_ok "Updated Heimdall Dashboard to ${RELEASE}" -msg_info "Starting ${APP}" -systemctl start heimdall.service -sleep 2 -msg_ok "Started ${APP}" -msg_ok "Updated Successfully" + msg_info "Restoring Data" + cd ~ + cp -R database-backup/* /opt/Heimdall/database + cp -R public-backup/* /opt/Heimdall/public + sleep 1 + msg_ok "Restored Data" + + msg_info "Cleanup" + rm -rf {${RELEASE}.tar.gz,Heimdall-${VER},public-backup,database-backup,Heimdall} + sleep 1 + msg_ok "Cleaned" + + msg_info "Starting ${APP}" + systemctl start heimdall.service + sleep 2 + msg_ok "Started ${APP}" + msg_ok "Updated Successfully" +else + msg_ok "No update required. ${APP} ia already at ${RELEASE}." +fi exit } From a6e5eefb3450c2cae57203af97e2de0c8f022bd8 Mon Sep 17 00:00:00 2001 From: tteckster Date: Wed, 10 Apr 2024 07:00:25 -0400 Subject: [PATCH 2/7] Update heimdalldashboard.sh tweak --- ct/heimdalldashboard.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ct/heimdalldashboard.sh b/ct/heimdalldashboard.sh index d79ac7061..338251c03 100644 --- a/ct/heimdalldashboard.sh +++ b/ct/heimdalldashboard.sh @@ -18,7 +18,7 @@ EOF } header_info echo -e "Loading..." -APP="Heimdall Dashboard" +APP="Heimdall-Dashboard" var_disk="2" var_cpu="1" var_ram="512" From 9c0f6b6a0c8fa1ae8f178633857790727feb4ddc Mon Sep 17 00:00:00 2001 From: tteckster Date: Wed, 10 Apr 2024 07:07:48 -0400 Subject: [PATCH 3/7] Update and rename heimdalldashboard-install.sh to heimdall-dashboard-install.sh --- ...eimdalldashboard-install.sh => heimdall-dashboard-install.sh} | 1 + 1 file changed, 1 insertion(+) rename install/{heimdalldashboard-install.sh => heimdall-dashboard-install.sh} (97%) diff --git a/install/heimdalldashboard-install.sh b/install/heimdall-dashboard-install.sh similarity index 97% rename from install/heimdalldashboard-install.sh rename to install/heimdall-dashboard-install.sh index 644e0c57f..a7d87559b 100644 --- a/install/heimdalldashboard-install.sh +++ b/install/heimdall-dashboard-install.sh @@ -23,6 +23,7 @@ $STD apt-get install -y php8.2-{bz2,curl,sqlite3,zip,xml} msg_ok "Installed Dependencies" RELEASE=$(curl -sX GET "https://api.github.com/repos/linuxserver/Heimdall/releases/latest" | awk '/tag_name/{print $4;exit}' FS='[""]') +echo "${RELEASE}" >/opt/${APPLICATION}_version.txt msg_info "Installing Heimdall Dashboard ${RELEASE}" wget -q https://github.com/linuxserver/Heimdall/archive/${RELEASE}.tar.gz tar xzf ${RELEASE}.tar.gz From 2ef0f9f5c6d984cd2dd1e1341bde0ef319c346f8 Mon Sep 17 00:00:00 2001 From: tteckster Date: Wed, 10 Apr 2024 07:13:55 -0400 Subject: [PATCH 4/7] Rename heimdalldashboard.sh to heimdall-dashboard.sh --- ct/{heimdalldashboard.sh => heimdall-dashboard.sh} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename ct/{heimdalldashboard.sh => heimdall-dashboard.sh} (100%) diff --git a/ct/heimdalldashboard.sh b/ct/heimdall-dashboard.sh similarity index 100% rename from ct/heimdalldashboard.sh rename to ct/heimdall-dashboard.sh From a38c9f84e09fe72d17e8b37dabe992fd440a5ae1 Mon Sep 17 00:00:00 2001 From: tteckster Date: Wed, 10 Apr 2024 07:20:01 -0400 Subject: [PATCH 5/7] Update heimdall-dashboard.sh fix fat finger --- ct/heimdall-dashboard.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ct/heimdall-dashboard.sh b/ct/heimdall-dashboard.sh index 338251c03..688439418 100644 --- a/ct/heimdall-dashboard.sh +++ b/ct/heimdall-dashboard.sh @@ -97,7 +97,7 @@ if [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]] || [[ ! -f /opt/${APP} msg_ok "Started ${APP}" msg_ok "Updated Successfully" else - msg_ok "No update required. ${APP} ia already at ${RELEASE}." + msg_ok "No update required. ${APP} is already at ${RELEASE}." fi exit } From de9beedd52d30e84841bdd437e736abffc794911 Mon Sep 17 00:00:00 2001 From: tteckster Date: Wed, 10 Apr 2024 07:34:23 -0400 Subject: [PATCH 6/7] Update heimdall-dashboard.sh tweak --- ct/heimdall-dashboard.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ct/heimdall-dashboard.sh b/ct/heimdall-dashboard.sh index 688439418..04db1ea7f 100644 --- a/ct/heimdall-dashboard.sh +++ b/ct/heimdall-dashboard.sh @@ -69,7 +69,6 @@ if [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]] || [[ ! -f /opt/${APP} msg_ok "Backed up Data" msg_info "Updating Heimdall Dashboard to ${RELEASE}" - echo "${RELEASE}" >/opt/${APP}_version.txt wget -q https://github.com/linuxserver/Heimdall/archive/${RELEASE}.tar.gz tar xzf ${RELEASE}.tar.gz VER=$(curl -s https://api.github.com/repos/linuxserver/Heimdall/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }') @@ -77,6 +76,7 @@ if [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]] || [[ ! -f /opt/${APP} cd /opt/Heimdall apt-get install -y composer &>/dev/null COMPOSER_ALLOW_SUPERUSER=1 composer dump-autoload &>/dev/null + echo "${RELEASE}" >/opt/${APP}_version.txt msg_ok "Updated Heimdall Dashboard to ${RELEASE}" msg_info "Restoring Data" From 4fecdcaa6a438bf024701a0f1773e31104922475 Mon Sep 17 00:00:00 2001 From: tteckster Date: Wed, 10 Apr 2024 20:02:02 -0400 Subject: [PATCH 7/7] Update filebrowser.sh add `curl` --- misc/filebrowser.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/misc/filebrowser.sh b/misc/filebrowser.sh index f15d05371..c4cc0e8d4 100644 --- a/misc/filebrowser.sh +++ b/misc/filebrowser.sh @@ -65,6 +65,7 @@ function msg_ok() { read -r -p "Would you like to use No Authentication? " prompt msg_info "Installing ${APP}" +apt-get install -y curl &>/dev/null RELEASE=$(curl -fsSL https://api.github.com/repos/filebrowser/filebrowser/releases/latest | grep -o '"tag_name": ".*"' | sed 's/"//g' | sed 's/tag_name: //g') curl -fsSL https://github.com/filebrowser/filebrowser/releases/download/$RELEASE/linux-amd64-filebrowser.tar.gz | tar -xzv -C /usr/local/bin &>/dev/null