Files
ProxmoxVE/ct/homebox.sh
T

73 lines
2.5 KiB
Bash
Raw Normal View History

#!/usr/bin/env bash
_cs_boot="${COMMUNITY_SCRIPTS_CORE_DIR:-$(dirname "${BASH_SOURCE[0]}")/../../core}/core/build.func"
source "$_cs_boot" 2>/dev/null || source <(curl -fsSL "${COMMUNITY_SCRIPTS_CORE_URL:-https://raw.githubusercontent.com/community-scripts/core/main}/core/build.func")
# Copyright (c) 2021-2026 tteck
# Author: tteck | Co-Author: MickLesk (Canbiz)
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
# Source: https://github.com/sysadminsmedia/homebox
2024-09-16 13:18:55 +02:00
APP="HomeBox"
var_tags="${var_tags:-inventory;household}"
var_cpu="${var_cpu:-1}"
var_ram="${var_ram:-1024}"
var_disk="${var_disk:-4}"
var_os="${var_os:-debian}"
var_version="${var_version:-13}"
var_arm64="${var_arm64:-yes}"
var_unprivileged="${var_unprivileged:-1}"
header_info "$APP"
2024-09-16 13:18:55 +02:00
variables
color
catch_errors
function update_script() {
header_info
check_container_storage
check_container_resources
2025-08-08 22:34:29 +02:00
if [[ ! -f /etc/systemd/system/homebox.service ]]; then
msg_error "No ${APP} Installation Found!"
exit
fi
2025-07-29 15:06:52 +02:00
if [[ -x /opt/homebox ]]; then
2025-08-27 09:38:14 +02:00
sed -i 's|WorkingDirectory=/opt$|WorkingDirectory=/opt/homebox|' /etc/systemd/system/homebox.service
sed -i 's|ExecStart=/opt/homebox$|ExecStart=/opt/homebox/homebox|' /etc/systemd/system/homebox.service
sed -i 's|EnvironmentFile=/opt/.env$|EnvironmentFile=/opt/homebox/.env|' /etc/systemd/system/homebox.service
2025-08-09 10:03:01 +02:00
systemctl daemon-reload
2025-07-29 15:06:52 +02:00
fi
2025-08-29 17:07:41 +02:00
if check_for_gh_release "homebox" "sysadminsmedia/homebox"; then
2025-10-10 11:15:44 +02:00
msg_info "Stopping Service"
systemctl stop homebox
2025-10-10 11:15:44 +02:00
msg_ok "Stopped Service"
2024-09-16 13:18:55 +02:00
create_backup /opt/homebox/.env /opt/homebox/.data
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "homebox" "sysadminsmedia/homebox" "prebuild" "latest" "/opt/homebox" "homebox_Linux_$(arch_resolve "x86_64" "arm64").tar.gz"
2025-07-29 15:06:52 +02:00
chmod +x /opt/homebox/homebox
restore_backup
2025-07-29 15:06:52 +02:00
[ -f /opt/.env ] && mv /opt/.env /opt/homebox/.env
2025-08-09 10:03:01 +02:00
[ -d /opt/.data ] && mv /opt/.data /opt/homebox/.data
2024-09-16 13:18:55 +02:00
2026-06-13 20:40:19 +02:00
if ! grep -q "HBOX_AUTH_API_KEY_PEPPER" /opt/homebox/.env; then
2026-10-03 08:19:10 +02:00
AUTH_KEY=$(random_password 32)
2026-06-13 20:40:19 +02:00
echo "HBOX_AUTH_API_KEY_PEPPER=${AUTH_KEY}" >>/opt/homebox/.env
fi
2025-10-10 11:15:44 +02:00
msg_info "Starting Service"
systemctl start homebox
2025-10-10 11:15:44 +02:00
msg_ok "Started Service"
msg_ok "Updated successfully!"
fi
exit
2024-09-16 13:18:55 +02:00
}
start
build_container
description
2026-01-06 22:57:40 +01:00
msg_ok "Completed successfully!\n"
echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}"
echo -e "${INFO}${YW}Access it using the following URL:${CL}"
echo -e "${GATEWAY}${BGN}http://${IP}:7745${CL}"