LibrePortal/scripts/update/backup/reset_git_backup.sh
librelad 875a60f90f LibrePortal v0.1.0 — initial release
A free, open, self-hosted app platform (GNU AGPLv3): one-click app deploys,
Traefik reverse proxy with automatic SSL, rootless Docker support, gluetun
VPN routing, and a web dashboard to manage it all.

Free & open forever to self-host; optional paid hosted services fund it.
See PROMISE.md.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

Signed-off-by: librelad <librelad@digitalangels.vip>
2026-05-21 20:37:54 +01:00

40 lines
1.4 KiB
Bash
Executable File

#!/bin/bash
gitFolderResetAndBackup()
{
isHeader "Updating LibrePortal"
update_done=false
if [ ! -d "$backup_install_dir/$backupFolder" ]; then
local result=$(createFolders "loud" $sudo_user_name "$backup_install_dir/$backupFolder")
checkSuccess "Create the backup folder"
fi
local result=$(cd $backup_install_dir)
checkSuccess "Going into the backup install folder"
local result=$(copyFolder "$configs_dir" "$backup_install_dir/$backupFolder" "$sudo_user_name")
checkSuccess "Copy the configs to the backup folder"
local result=$(copyFolder "$logs_dir" "$backup_install_dir/$backupFolder" "$sudo_user_name")
checkSuccess "Copy the logs to the backup folder"
gitReset;
local result=$(copyFolders "$backup_install_dir/$backupFolder/" "$docker_dir" "$sudo_user_name")
checkSuccess "Copy the backed up folders back into the installation directory"
local result=$(sudo -u $sudo_user_name zip -r "$backup_install_dir/$backupFolder.zip" "$backup_install_dir/$backupFolder")
checkSuccess "Zipping up the the backup folder for safe keeping"
gitCleanInstallBackups;
gitUntrackFiles;
isSuccessful "Custom changes have been discarded successfully"
echo ""
isNotice "You have updated your version of LibrePortal."
isNotice "To avoid any issues please rerun the 'libreportal'."
echo ""
exit
update_done=true
}