Refactor install scripts and cleanup handling

Replaces manual apt cleanup commands with a unified cleanup_lxc function across install scripts. Updates apt-get to apt for package installation, improves repository setup logic, and standardizes service creation. Minor messaging and variable usage improvements for consistency.
This commit is contained in:
CanbiZ
2025-11-12 11:39:28 +01:00
parent e5c3c19106
commit 5d2d54368a
12 changed files with 48 additions and 88 deletions

View File

@@ -622,7 +622,8 @@ setup_deb822_repo() {
}
# Create deb822 sources file
cat <<EOF >/etc/apt/sources.list.d/${name}.sources
if [[ -n "$component" ]]; then
cat <<EOF >/etc/apt/sources.list.d/${name}.sources
Types: deb
URIs: $repo_url
Suites: $suite
@@ -630,6 +631,15 @@ Components: $component
Architectures: $architectures
Signed-By: /etc/apt/keyrings/${name}.gpg
EOF
else
cat <<EOF >/etc/apt/sources.list.d/${name}.sources
Types: deb
URIs: $repo_url
Suites: $suite
Architectures: $architectures
Signed-By: /etc/apt/keyrings/${name}.gpg
EOF
fi
# Use cached apt update
local apt_cache_file="/var/cache/apt-update-timestamp"
@@ -1141,7 +1151,7 @@ function fetch_and_deploy_gh_release() {
rm -rf "${target:?}/"*
fi
tar --no-same-owner -xzf "$tmpdir/$filename" -C "$tmpdir" || {
tar --no-same-owner -xzf "$tmpdir/$filename" -C "$tmpdir" || {
msg_error "Failed to extract tarball"
rm -rf "$tmpdir"
return 1