mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2026-04-26 10:51:15 +00:00
fix(mealie): fallback heredoc if start.sh missing before backup
This commit is contained in:
parent
a6fb551ee5
commit
4f68f18961
1 changed files with 12 additions and 2 deletions
14
ct/mealie.sh
14
ct/mealie.sh
|
|
@ -38,14 +38,24 @@ function update_script() {
|
|||
|
||||
msg_info "Backing up Configuration"
|
||||
cp -f /opt/mealie/mealie.env /opt/mealie.env
|
||||
cp -f /opt/mealie/start.sh /opt/mealie.start.sh
|
||||
[[ -f /opt/mealie/start.sh ]] && cp -f /opt/mealie/start.sh /opt/mealie.start.sh
|
||||
msg_ok "Backup completed"
|
||||
|
||||
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "mealie" "mealie-recipes/mealie" "tarball"
|
||||
|
||||
msg_info "Restoring Configuration"
|
||||
mv -f /opt/mealie.env /opt/mealie/mealie.env
|
||||
mv -f /opt/mealie.start.sh /opt/mealie/start.sh
|
||||
if [[ -f /opt/mealie.start.sh ]]; then
|
||||
mv -f /opt/mealie.start.sh /opt/mealie/start.sh
|
||||
else
|
||||
cat <<'STARTEOF' >/opt/mealie/start.sh
|
||||
#!/bin/bash
|
||||
set -a
|
||||
source /opt/mealie/mealie.env
|
||||
set +a
|
||||
exec uv run mealie
|
||||
STARTEOF
|
||||
fi
|
||||
chmod +x /opt/mealie/start.sh
|
||||
msg_ok "Configuration restored"
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue