parent
815720b59e
commit
ab6f2dd24f
@ -22,26 +22,24 @@ function update_script() {
|
|||||||
header_info
|
header_info
|
||||||
check_container_storage
|
check_container_storage
|
||||||
check_container_resources
|
check_container_resources
|
||||||
if [[ ! -f /opt/homebox ]]; then
|
if [[ ! -d /opt/homebox ]]; then
|
||||||
msg_error "No ${APP} Installation Found!"
|
msg_error "No ${APP} Installation Found!"
|
||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
RELEASE=$(curl -fsSL https://api.github.com/repos/sysadminsmedia/homebox/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }')
|
if [[ -x /opt/homebox ]]; then
|
||||||
if [[ ! -f /opt/${APP}_version.txt ]] || [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]]; then
|
sed -i 's|/opt\b|/opt/homebox|g' /etc/systemd/system/homebox.service
|
||||||
|
sed -i 's|^ExecStart=/opt/homebox$|ExecStart=/opt/homebox/homebox|' /etc/systemd/system/homebox.service
|
||||||
|
fi
|
||||||
|
|
||||||
|
RELEASE=$(curl -fsSL https://api.github.com/repos/sysadminsmedia/homebox/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
|
||||||
|
if [[ "${RELEASE}" != "$(cat ~/.homebox 2>/dev/null)" ]] || [[ ! -f ~/.homebox ]]; then
|
||||||
msg_info "Stopping ${APP}"
|
msg_info "Stopping ${APP}"
|
||||||
systemctl stop homebox
|
systemctl stop homebox
|
||||||
msg_ok "${APP} Stopped"
|
msg_ok "${APP} Stopped"
|
||||||
|
|
||||||
msg_info "Updating ${APP} to ${RELEASE}"
|
fetch_and_deploy_gh_release "homebox" "sysadminsmedia/homebox" "prebuild" "latest" "/opt/homebox" "homebox_Linux_x86_64.tar.gz"
|
||||||
cd /opt
|
chmod +x /opt/homebox/homebox
|
||||||
rm -rf homebox_bak
|
[ -f /opt/.env ] && mv /opt/.env /opt/homebox/.env
|
||||||
rm -rf /tmp/homebox.tar.gz
|
|
||||||
mv homebox homebox_bak
|
|
||||||
curl -fsSL "https://github.com/sysadminsmedia/homebox/releases/download/${RELEASE}/homebox_Linux_x86_64.tar.gz" -o "/tmp/homebox.tar.gz"
|
|
||||||
tar -xzf /tmp/homebox.tar.gz -C /opt
|
|
||||||
chmod +x /opt/homebox
|
|
||||||
echo "${RELEASE}" >/opt/${APP}_version.txt
|
|
||||||
msg_ok "Updated Homebox"
|
|
||||||
|
|
||||||
msg_info "Starting ${APP}"
|
msg_info "Starting ${APP}"
|
||||||
systemctl start homebox
|
systemctl start homebox
|
||||||
@ -61,4 +59,4 @@ description
|
|||||||
msg_ok "Completed Successfully!\n"
|
msg_ok "Completed Successfully!\n"
|
||||||
echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}"
|
echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}"
|
||||||
echo -e "${INFO}${YW} Access it using the following URL:${CL}"
|
echo -e "${INFO}${YW} Access it using the following URL:${CL}"
|
||||||
echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:7745${CL}"
|
echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:7745${CL}"
|
||||||
|
@ -9,10 +9,10 @@
|
|||||||
"updateable": true,
|
"updateable": true,
|
||||||
"privileged": false,
|
"privileged": false,
|
||||||
"interface_port": 7745,
|
"interface_port": 7745,
|
||||||
"documentation": null,
|
"documentation": "https://homebox.software/en/quick-start.html",
|
||||||
"website": "https://homebox.software/en/",
|
"website": "https://homebox.software/en/",
|
||||||
"logo": "https://cdn.jsdelivr.net/gh/selfhst/icons/webp/homebox.webp",
|
"logo": "https://cdn.jsdelivr.net/gh/selfhst/icons/webp/homebox.webp",
|
||||||
"config_path": "/opt/.env",
|
"config_path": "/opt/homebox/.env",
|
||||||
"description": "HomeBox is a simple, home-focused inventory management software. It allows users to organize and track household items by adding, updating, or deleting them. Features include optional details like warranty info, CSV import/export, custom labels, locations, and multi-tenant support for sharing with others. It\u2019s designed to be fast, easy to use, and portable.",
|
"description": "HomeBox is a simple, home-focused inventory management software. It allows users to organize and track household items by adding, updating, or deleting them. Features include optional details like warranty info, CSV import/export, custom labels, locations, and multi-tenant support for sharing with others. It\u2019s designed to be fast, easy to use, and portable.",
|
||||||
"install_methods": [
|
"install_methods": [
|
||||||
{
|
{
|
||||||
@ -31,10 +31,5 @@
|
|||||||
"username": null,
|
"username": null,
|
||||||
"password": null
|
"password": null
|
||||||
},
|
},
|
||||||
"notes": [
|
"notes": []
|
||||||
{
|
|
||||||
"text": ".env file location: `/opt/.env`",
|
|
||||||
"type": "info"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
|
@ -14,18 +14,17 @@ setting_up_container
|
|||||||
network_check
|
network_check
|
||||||
update_os
|
update_os
|
||||||
|
|
||||||
msg_info "Installing Homebox"
|
fetch_and_deploy_gh_release "homebox" "sysadminsmedia/homebox" "prebuild" "latest" "/opt/homebox" "homebox_Linux_x86_64.tar.gz"
|
||||||
RELEASE=$(curl -fsSL https://api.github.com/repos/sysadminsmedia/homebox/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }')
|
|
||||||
curl -fsSL "https://github.com/sysadminsmedia/homebox/releases/download/${RELEASE}/homebox_Linux_x86_64.tar.gz" | tar -xzf - -C /opt
|
msg_info "Configuring Homebox"
|
||||||
chmod +x /opt/homebox
|
chmod +x /opt/homebox/homebox
|
||||||
cat <<EOF >/opt/.env
|
cat <<EOF >/opt/homebox/.env
|
||||||
# For possible environment variables check here: https://homebox.software/en/configure-homebox
|
# For possible environment variables check here: https://homebox.software/en/configure-homebox
|
||||||
HBOX_MODE=production
|
HBOX_MODE=production
|
||||||
HBOX_WEB_PORT=7745
|
HBOX_WEB_PORT=7745
|
||||||
HBOX_WEB_HOST=0.0.0.0
|
HBOX_WEB_HOST=0.0.0.0
|
||||||
EOF
|
EOF
|
||||||
echo "${RELEASE}" >"/opt/${APPLICATION}_version.txt"
|
msg_ok "Configured Homebox"
|
||||||
msg_ok "Installed Homebox"
|
|
||||||
|
|
||||||
msg_info "Creating Service"
|
msg_info "Creating Service"
|
||||||
cat <<EOF >/etc/systemd/system/homebox.service
|
cat <<EOF >/etc/systemd/system/homebox.service
|
||||||
@ -34,9 +33,9 @@ Description=Start Homebox Service
|
|||||||
After=network.target
|
After=network.target
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
WorkingDirectory=/opt
|
WorkingDirectory=/opt/homebox
|
||||||
ExecStart=/opt/homebox
|
ExecStart=/opt/homebox/homebox
|
||||||
EnvironmentFile=/opt/.env
|
EnvironmentFile=/opt/homebox/.env
|
||||||
Restart=on-failure
|
Restart=on-failure
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user