Refactor (#9839)
This commit is contained in:
parent
fe8e1be644
commit
cafee135c4
@ -27,24 +27,18 @@ 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/PCJones/Umlautadaptarr/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3)}')
|
|
||||||
if [[ ! -f /opt/UmlautAdaptarr_version.txt ]] || [[ "${RELEASE}" != "$(cat /opt/UmlautAdaptarr_version.txt)" ]]; then
|
if check_for_gh_release "UmlautAdaptarr" "PCJones/Umlautadaptarr"; then
|
||||||
msg_info "Stopping Service"
|
msg_info "Stopping Service"
|
||||||
systemctl stop umlautadaptarr
|
systemctl stop umlautadaptarr
|
||||||
msg_ok "Stopped Service"
|
msg_ok "Stopped Service"
|
||||||
|
|
||||||
msg_info "Updating ${APP}"
|
fetch_and_deploy_gh_release "UmlautAdaptarr" "PCJones/Umlautadaptarr" "prebuild" "latest" "/opt/UmlautAdaptarr" "linux-x64.zip"
|
||||||
temp_file=$(mktemp)
|
|
||||||
curl -fsSL "https://github.com/PCJones/Umlautadaptarr/releases/download/${RELEASE}/linux-x64.zip" -o $temp_file
|
|
||||||
$STD unzip -u $temp_file '*/**' -d /opt/UmlautAdaptarr
|
|
||||||
msg_ok "Updated ${APP}"
|
|
||||||
|
|
||||||
msg_info "Starting Service"
|
msg_info "Starting Service"
|
||||||
systemctl start umlautadaptarr
|
systemctl start umlautadaptarr
|
||||||
msg_ok "Started Service"
|
msg_ok "Started Service"
|
||||||
msg_ok "Updated successfully!"
|
msg_ok "Updated successfully!"
|
||||||
else
|
|
||||||
msg_ok "No update required. ${APP} is already at ${RELEASE}"
|
|
||||||
fi
|
fi
|
||||||
exit
|
exit
|
||||||
}
|
}
|
||||||
|
|||||||
@ -9,7 +9,7 @@
|
|||||||
"updateable": true,
|
"updateable": true,
|
||||||
"privileged": false,
|
"privileged": false,
|
||||||
"interface_port": 5005,
|
"interface_port": 5005,
|
||||||
"documentation": null,
|
"documentation": "https://github.com/PCJones/UmlautAdaptarr/blob/master/README.md",
|
||||||
"website": "https://github.com/PCJones/UmlautAdaptarr",
|
"website": "https://github.com/PCJones/UmlautAdaptarr",
|
||||||
"logo": "https://raw.githubusercontent.com/community-scripts/ProxmoxVE/refs/heads/main/misc/images/logo.png",
|
"logo": "https://raw.githubusercontent.com/community-scripts/ProxmoxVE/refs/heads/main/misc/images/logo.png",
|
||||||
"config_path": "/opt/UmlautAdaptarr/appsettings.json",
|
"config_path": "/opt/UmlautAdaptarr/appsettings.json",
|
||||||
|
|||||||
@ -14,30 +14,20 @@ network_check
|
|||||||
update_os
|
update_os
|
||||||
|
|
||||||
msg_info "Installing Dependencies"
|
msg_info "Installing Dependencies"
|
||||||
curl -fsSL https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor -o /usr/share/keyrings/microsoft-prod.gpg
|
setup_deb822_repo \
|
||||||
cat <<EOF | sudo tee /etc/apt/sources.list.d/microsoft-prod.sources >/dev/null
|
"microsoft" \
|
||||||
Types: deb
|
"https://packages.microsoft.com/keys/microsoft.asc" \
|
||||||
URIs: https://packages.microsoft.com/debian/12/prod/
|
"https://packages.microsoft.com/debian/12/prod/" \
|
||||||
Suites: bookworm
|
"bookworm" \
|
||||||
Components: main
|
"main"
|
||||||
Signed-By: /usr/share/keyrings/microsoft-prod.gpg
|
|
||||||
EOF
|
|
||||||
$STD apt update
|
|
||||||
$STD apt install -y \
|
$STD apt install -y \
|
||||||
dotnet-sdk-8.0 \
|
dotnet-sdk-8.0 \
|
||||||
aspnetcore-runtime-8.0
|
aspnetcore-runtime-8.0
|
||||||
msg_ok "Installed Dependencies"
|
msg_ok "Installed Dependencies"
|
||||||
|
|
||||||
msg_info "Installing Umlautadaptarr"
|
fetch_and_deploy_gh_release "UmlautAdaptarr" "PCJones/Umlautadaptarr" "prebuild" "latest" "/opt/UmlautAdaptarr" "linux-x64.zip"
|
||||||
temp_file=$(mktemp)
|
|
||||||
RELEASE=$(curl -s https://api.github.com/repos/PCJones/Umlautadaptarr/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3)}')
|
|
||||||
curl -fsSL "https://github.com/PCJones/Umlautadaptarr/releases/download/${RELEASE}/linux-x64.zip" -o $temp_file
|
|
||||||
$STD unzip -j $temp_file '*/**' -d /opt/UmlautAdaptarr
|
|
||||||
rm -f $temp_file
|
|
||||||
echo "${RELEASE}" >"/opt/UmlautAdaptarr_version.txt"
|
|
||||||
msg_ok "Installation completed"
|
|
||||||
|
|
||||||
msg_info "Creating appsettings.json"
|
msg_info "Setting up UmlautAdaptarr"
|
||||||
cat <<EOF >/opt/UmlautAdaptarr/appsettings.json
|
cat <<EOF >/opt/UmlautAdaptarr/appsettings.json
|
||||||
{
|
{
|
||||||
"Logging": {
|
"Logging": {
|
||||||
@ -97,7 +87,7 @@ cat <<EOF >/opt/UmlautAdaptarr/appsettings.json
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
EOF
|
EOF
|
||||||
msg_ok "appsettings.json created"
|
msg_ok "Setup UmlautAdaptarr"
|
||||||
|
|
||||||
msg_info "Creating Service"
|
msg_info "Creating Service"
|
||||||
cat <<EOF >/etc/systemd/system/umlautadaptarr.service
|
cat <<EOF >/etc/systemd/system/umlautadaptarr.service
|
||||||
@ -116,7 +106,7 @@ Environment=ASPNETCORE_ENVIRONMENT=Production
|
|||||||
[Install]
|
[Install]
|
||||||
WantedBy=multi-user.target
|
WantedBy=multi-user.target
|
||||||
EOF
|
EOF
|
||||||
systemctl -q --now enable umlautadaptarr
|
systemctl enable -q --now umlautadaptarr
|
||||||
msg_ok "Created Service"
|
msg_ok "Created Service"
|
||||||
|
|
||||||
motd_ssh
|
motd_ssh
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user