Files
HomeServerCTs/CT-Files/aptcacherng/Scripts/Init.sh
Bram Prieshof 0876675006 CT Linkwarden Postgresq: Debian 13 fixes
linkwarden: removed unnecessary build step, fixed deploy command
postgresql: locked major version, bumpt it from 17 to 18, updated config for compatibility, added sleep to config to make sure Postgres is up
aptcacherng: skips overwriting existing service symlink
2025-10-28 00:17:08 +01:00

16 lines
939 B
Bash

#!/bin/ash
#Get Resources
curl -L --retry 7 --retry-delay 5 http://dl-4.alpinelinux.org/alpine/MIRRORS.txt -o /etc/apt-cacher-ng/alpine_mirrors || exit 1
curl -L --retry 7 --retry-delay 5 https://www.centos.org/download/full-mirrorlist.csv | sed 's/^.*"http:/http:/' | sed 's/".*$//' | grep ^http > /etc/apt-cacher-ng/centos_mirrors
#Allow apt-cacher-ng to use port 80 (Debian 11)
##setcap 'cap_net_bind_service=+ep' /usr/sbin/apt-cacher-ng
#Allow apt-cacher-ng to use port 80 (Debian 12)
setcap 'cap_net_bind_service=+ep' /sbin/apt-cacher-ng
#Move configs in place
mv /opt/Setup/Configs/acng.conf /etc/apt-cacher-ng/acng.conf
mv /opt/Setup/Scripts/UpdateMirrorList.sh /opt/UpdateMirrorList.sh
#Enable apt-cacher-ng on startup
if ! [ -f /etc/systemd/system/multi-user.target.wants/apt-cacher-ng.service ]; then
ln -s /lib/systemd/system/apt-cacher-ng.service /etc/systemd/system/multi-user.target.wants/apt-cacher-ng.service || true
fi