Compare commits

...

6 Commits

Author SHA1 Message Date
tteckster de9beedd52
Update heimdall-dashboard.sh
tweak
2024-04-10 07:34:23 -04:00
tteckster a38c9f84e0
Update heimdall-dashboard.sh
fix fat finger
2024-04-10 07:20:01 -04:00
tteckster 2ef0f9f5c6
Rename heimdalldashboard.sh to heimdall-dashboard.sh 2024-04-10 07:13:55 -04:00
tteckster 9c0f6b6a0c
Update and rename heimdalldashboard-install.sh to heimdall-dashboard-install.sh 2024-04-10 07:07:48 -04:00
tteckster a6e5eefb34
Update heimdalldashboard.sh
tweak
2024-04-10 07:00:25 -04:00
tteckster a9742f18cd
Update heimdalldashboard.sh
tweak update function
2024-04-10 06:56:56 -04:00
2 changed files with 42 additions and 40 deletions

View File

@ -18,7 +18,7 @@ EOF
} }
header_info header_info
echo -e "Loading..." echo -e "Loading..."
APP="Heimdall Dashboard" APP="Heimdall-Dashboard"
var_disk="2" var_disk="2"
var_cpu="1" var_cpu="1"
var_ram="512" var_ram="512"
@ -55,49 +55,50 @@ function default_settings() {
function update_script() { function update_script() {
header_info header_info
if [[ ! -d /opt/Heimdall ]]; then msg_error "No ${APP} Installation Found!"; exit; fi 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='[""]') 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}" if [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]] || [[ ! -f /opt/${APP}_version.txt ]]; then
wget -q https://github.com/linuxserver/Heimdall/archive/${RELEASE}.tar.gz msg_info "Stopping ${APP}"
tar xzf ${RELEASE}.tar.gz systemctl stop heimdall
VER=$(curl -s https://api.github.com/repos/linuxserver/Heimdall/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }') sleep 1
cp -R Heimdall-${VER}/* /opt/Heimdall msg_ok "Stopped ${APP}"
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 "Restoring Data" msg_info "Backing up Data"
cd ~ cp -R /opt/Heimdall/database database-backup
cp -R database-backup/* /opt/Heimdall/database cp -R /opt/Heimdall/public public-backup
cp -R public-backup/* /opt/Heimdall/public sleep 1
sleep 1 msg_ok "Backed up Data"
msg_ok "Restored Data"
msg_info "Cleanup" msg_info "Updating Heimdall Dashboard to ${RELEASE}"
rm -rf ${RELEASE}.tar.gz wget -q https://github.com/linuxserver/Heimdall/archive/${RELEASE}.tar.gz
rm -rf Heimdall-${VER} tar xzf ${RELEASE}.tar.gz
rm -rf public-backup VER=$(curl -s https://api.github.com/repos/linuxserver/Heimdall/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
rm -rf database-backup cp -R Heimdall-${VER}/* /opt/Heimdall
rm -rf Heimdall cd /opt/Heimdall
sleep 1 apt-get install -y composer &>/dev/null
msg_ok "Cleaned" COMPOSER_ALLOW_SUPERUSER=1 composer dump-autoload &>/dev/null
echo "${RELEASE}" >/opt/${APP}_version.txt
msg_ok "Updated Heimdall Dashboard to ${RELEASE}"
msg_info "Starting ${APP}" msg_info "Restoring Data"
systemctl start heimdall.service cd ~
sleep 2 cp -R database-backup/* /opt/Heimdall/database
msg_ok "Started ${APP}" cp -R public-backup/* /opt/Heimdall/public
msg_ok "Updated Successfully" 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} is already at ${RELEASE}."
fi
exit exit
} }

View File

@ -23,6 +23,7 @@ $STD apt-get install -y php8.2-{bz2,curl,sqlite3,zip,xml}
msg_ok "Installed Dependencies" msg_ok "Installed Dependencies"
RELEASE=$(curl -sX GET "https://api.github.com/repos/linuxserver/Heimdall/releases/latest" | awk '/tag_name/{print $4;exit}' FS='[""]') 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}" msg_info "Installing Heimdall Dashboard ${RELEASE}"
wget -q https://github.com/linuxserver/Heimdall/archive/${RELEASE}.tar.gz wget -q https://github.com/linuxserver/Heimdall/archive/${RELEASE}.tar.gz
tar xzf ${RELEASE}.tar.gz tar xzf ${RELEASE}.tar.gz