This commit is contained in:
Slaviša Arežina 2025-08-16 22:40:14 +02:00 committed by GitHub
parent ff77960aa6
commit 363685d3d3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 11 additions and 23 deletions

View File

@ -27,17 +27,19 @@ function update_script() {
msg_error "No ${APP} Installation Found!" msg_error "No ${APP} Installation Found!"
exit exit
fi fi
RELEASE=$(curl -fsSL https://api.github.com/repos/ellite/Wallos/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }') RELEASE=$(curl -fsSL https://api.github.com/repos/ellite/Wallos/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
if [[ ! -f /opt/${APP}_version.txt ]] || [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]]; then if [[ ! -f ~/.wallos ]] || [[ "${RELEASE}" != "$(cat ~/.wallos)" ]]; then
msg_info "Updating ${APP} to ${RELEASE}" msg_info "Creating backup"
cd /opt
curl -fsSL "https://github.com/ellite/Wallos/archive/refs/tags/v${RELEASE}.zip" -o $(basename "https://github.com/ellite/Wallos/archive/refs/tags/v${RELEASE}.zip")
mkdir -p /opt/logos mkdir -p /opt/logos
mv /opt/wallos/db/wallos.db /opt/wallos.db mv /opt/wallos/db/wallos.db /opt/wallos.db
mv /opt/wallos/images/uploads/logos /opt/logos/ mv /opt/wallos/images/uploads/logos /opt/logos/
$STD unzip v${RELEASE}.zip msg_ok "Backup created"
rm -rf /opt/wallos rm -rf /opt/wallos
mv Wallos-${RELEASE} /opt/wallos fetch_and_deploy_gh_release "wallos" "ellite/Wallos" "tarball"
msg_info "Configuring ${APP}"
rm -rf /opt/wallos/db/wallos.empty.db rm -rf /opt/wallos/db/wallos.empty.db
mv /opt/wallos.db /opt/wallos/db/wallos.db mv /opt/wallos.db /opt/wallos/db/wallos.db
mv /opt/logos/* /opt/wallos/images/uploads/logos mv /opt/logos/* /opt/wallos/images/uploads/logos
@ -48,16 +50,12 @@ function update_script() {
chmod -R 755 /opt/wallos chmod -R 755 /opt/wallos
mkdir -p /var/log/cron mkdir -p /var/log/cron
$STD curl http://localhost/endpoints/db/migrate.php $STD curl http://localhost/endpoints/db/migrate.php
echo "${RELEASE}" >/opt/${APP}_version.txt msg_ok "Configured ${APP}"
msg_ok "Updated ${APP}"
msg_info "Reload Apache2" msg_info "Reload Apache2"
systemctl reload apache2 systemctl reload apache2
msg_ok "Apache2 Reloaded" msg_ok "Apache2 Reloaded"
msg_info "Cleaning Up"
rm -R /opt/v${RELEASE}.zip
msg_ok "Cleaned"
msg_ok "Updated Successfully" msg_ok "Updated Successfully"
else else
msg_ok "No update required. ${APP} is already at ${RELEASE}" msg_ok "No update required. ${APP} is already at ${RELEASE}"

View File

@ -14,19 +14,10 @@ setting_up_container
network_check network_check
update_os update_os
msg_info "Installing Dependencies" PHP_VERSION="8.4" PHP_APACHE="YES" PHP_MODULE="imagick,bz2,sqlite3" setup_php
$STD apt-get install -y \ fetch_and_deploy_gh_release "wallos" "ellite/Wallos" "tarball"
apache2 \
libapache2-mod-php \
php8.2-{mbstring,gd,curl,intl,imagick,bz2,sqlite3,zip,xml}
msg_ok "Installed Dependencies"
msg_info "Installing Wallos (Patience)" msg_info "Installing Wallos (Patience)"
cd /opt
RELEASE=$(curl -fsSL https://api.github.com/repos/ellite/Wallos/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
curl -fsSL "https://github.com/ellite/Wallos/archive/refs/tags/v${RELEASE}.zip" -o "v${RELEASE}.zip"
$STD unzip v${RELEASE}.zip
mv Wallos-${RELEASE} /opt/wallos
cd /opt/wallos cd /opt/wallos
mv /opt/wallos/db/wallos.empty.db /opt/wallos/db/wallos.db mv /opt/wallos/db/wallos.empty.db /opt/wallos/db/wallos.db
chown -R www-data:www-data /opt/wallos chown -R www-data:www-data /opt/wallos
@ -73,7 +64,6 @@ motd_ssh
customize customize
msg_info "Cleaning up" msg_info "Cleaning up"
rm -rf /opt/v${RELEASE}.zip
$STD apt-get -y autoremove $STD apt-get -y autoremove
$STD apt-get -y autoclean $STD apt-get -y autoclean
msg_ok "Cleaned" msg_ok "Cleaned"