Simplify and clean up provisioning scripts
- lib/distro.sh: add DISTRO_CODENAME from VERSION_CODENAME; remove unused REPO_ADD_RPM variable; export DISTRO_CODENAME - stages/01-repos.sh: replace repeated '. /etc/os-release' subshell calls with $DISTRO_CODENAME in Docker and Tailscale repo lines - stages/00-envcheck.sh: combine four mkdir -p calls into one - stages/02-packages.sh: remove identical if/else branches in fd symlink block; both branches were the same command - stages/03-toolchains.sh: set NVM_DIR once before the if/else instead of twice; remove dead commented-out duplicate curl line - stages/04-shell.sh: capture $(date +%Y%m%d) into _bak_date once per backup and reuse in cp and warn to avoid redundant forks - stages/06-scripts.sh: split 'export VAR=$(cmd)' into assignment + export to correctly propagate errors under set -euo pipefail - stages/07-uv-projects.sh: remove unused has_package_json field (always false, never read); fix stage completion message 06 -> 07 - stages/08-systemd.sh: remove mempi-sync.timer (deploy, enable, header comment); deploy mempi-sync.service only - stages/09-desktop.sh: remove duplicate mkdir -p in COSMIC section; remove unused repo_url parameter from install_nerd_font() - stages/12-other-apps.sh: replace manual distro branch for Nextcloud with pkg_install_mapped - config/scripts/bw-load-ssh.sh: split 'export BW_SESSION=$(cat ...)' into assignment + export - config/systemd/mempi-sync.timer: delete file
This commit is contained in:
@@ -67,7 +67,7 @@ EOF
|
||||
if [ ! -f /etc/apt/sources.list.d/docker.list ]; then
|
||||
add_gpg_key "https://download.docker.com/linux/${DISTRO_ID}/gpg" \
|
||||
"/etc/apt/keyrings/docker.asc"
|
||||
echo "deb [arch=amd64 signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/${DISTRO_ID} ${DISTRO_VERSION_CODENAME:-$(. /etc/os-release && echo "$VERSION_CODENAME")} stable" | \
|
||||
echo "deb [arch=amd64 signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/${DISTRO_ID} ${DISTRO_CODENAME} stable" | \
|
||||
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
|
||||
ok " Docker CE repo added."
|
||||
fi
|
||||
@@ -75,11 +75,11 @@ EOF
|
||||
# ---- Tailscale ----
|
||||
info " Adding Tailscale repo..."
|
||||
if [ ! -f /etc/apt/sources.list.d/tailscale.list ]; then
|
||||
add_gpg_key "https://pkgs.tailscale.com/stable/${DISTRO_ID}/$(. /etc/os-release && echo "$VERSION_CODENAME").gz" \
|
||||
add_gpg_key "https://pkgs.tailscale.com/stable/${DISTRO_ID}/${DISTRO_CODENAME}.gz" \
|
||||
"/usr/share/keyrings/tailscale-archive-keyring.gpg" 2>/dev/null || \
|
||||
add_gpg_key "https://pkgs.tailscale.com/stable/${DISTRO_ID}/repo.gpg" \
|
||||
"/usr/share/keyrings/tailscale-archive-keyring.gpg"
|
||||
echo "deb [signed-by=/usr/share/keyrings/tailscale-archive-keyring.gpg] https://pkgs.tailscale.com/stable/${DISTRO_ID} $(. /etc/os-release && echo "$VERSION_CODENAME") main" | \
|
||||
echo "deb [signed-by=/usr/share/keyrings/tailscale-archive-keyring.gpg] https://pkgs.tailscale.com/stable/${DISTRO_ID} ${DISTRO_CODENAME} main" | \
|
||||
sudo tee /etc/apt/sources.list.d/tailscale.list > /dev/null
|
||||
ok " Tailscale repo added."
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user