Update hortusfox.sh
This commit is contained in:
parent
63611a8fe1
commit
81c9cfc253
@ -6,7 +6,7 @@ source <(curl -fsSL https://git.community-scripts.org/community-scripts/ProxmoxV
|
|||||||
# Source: https://github.com/danielbrendel/hortusfox-web
|
# Source: https://github.com/danielbrendel/hortusfox-web
|
||||||
|
|
||||||
APP="HortusFox"
|
APP="HortusFox"
|
||||||
var_tags="${var_tags:-network}"
|
var_tags="${var_tags:-plants}"
|
||||||
var_cpu="${var_cpu:-4}"
|
var_cpu="${var_cpu:-4}"
|
||||||
var_ram="${var_ram:-4096}"
|
var_ram="${var_ram:-4096}"
|
||||||
var_disk="${var_disk:-15}"
|
var_disk="${var_disk:-15}"
|
||||||
@ -27,25 +27,33 @@ 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/danielbrendel/hortusfox-web/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }')
|
RELEASE=$(curl -fsSL https://api.github.com/repos/danielbrendel/hortusfox-web/releases/latest | jq -r .tag_name | sed 's/^v//')
|
||||||
if [[ ! -f /opt/${APP}_version.txt ]] || [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]]; then
|
if [[ ! -f ~/.hortusfox ]] || [[ "${RELEASE}" != "$(cat ~/.hortusfox)" ]]; then
|
||||||
msg_info "Stopping Service"
|
msg_info "Stopping Service"
|
||||||
systemctl stop apache2
|
systemctl stop apache2
|
||||||
msg_ok "Stopped Service"
|
msg_ok "Stopped Service"
|
||||||
|
|
||||||
msg_info "Updating ${APP} to v${RELEASE}"
|
msg_info "Backing up current HortusFox installation"
|
||||||
cd /opt
|
cd /opt
|
||||||
mv /opt/hortusfox/ /opt/hortusfox-backup
|
mv /opt/hortusfox/ /opt/hortusfox-backup
|
||||||
|
msg_ok "Backed up current HortusFox installation"
|
||||||
|
|
||||||
echo "${RELEASE}" >/opt/${APP}_version.txt
|
fetch_and_deploy_gh_release "hortusfox" "danielbrendel/hortusfox-web"
|
||||||
msg_ok "Updated $APP to v${RELEASE}"
|
|
||||||
|
msg_info "Updating HortusFox"
|
||||||
|
cd /opt/hortusfox
|
||||||
|
mv /opt/hortusfox-backup/.env /opt/hortusfox/.env
|
||||||
|
$STD composer install --no-dev --optimize-autoloader
|
||||||
|
php asatru migrate --no-interaction
|
||||||
|
php asatru plants:attributes
|
||||||
|
php asatru calendar:classes
|
||||||
|
msg_ok "Updated HortusFox"
|
||||||
|
|
||||||
msg_info "Starting Service"
|
msg_info "Starting Service"
|
||||||
systemctl start service
|
systemctl start apache2
|
||||||
msg_ok "Started Service"
|
msg_ok "Started Service"
|
||||||
|
|
||||||
msg_info "Cleaning up"
|
msg_info "Cleaning up"
|
||||||
rm -r "/opt/${RELEASE}.zip"
|
|
||||||
rm -r /opt/hortusfox-backup
|
rm -r /opt/hortusfox-backup
|
||||||
msg_ok "Cleaned"
|
msg_ok "Cleaned"
|
||||||
msg_ok "Updated Successfully"
|
msg_ok "Updated Successfully"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user