This commit is contained in:
ggodot 2025-12-31 14:32:28 +01:00
commit d2ec804aa2
2 changed files with 84 additions and 0 deletions

28
bridge.sh Normal file
View File

@ -0,0 +1,28 @@
#!/bin/bash
# installs on deb13
printf "\nWhat ip range do you want to route?"
printf "\nformat: 172.168.1.0/24"
read ip_range
# installs
apt update
apt install networkd-dispatcher
systemctl enable networkd-dispatcher
systemctl start networkd-dispatcher
# tcp forwarding
echo 'net.ipv4.ip_forward = 1' | tee -a /etc/sysctl.d/99-tailscale.conf
echo 'net.ipv6.conf.all.forwarding = 1' | tee -a /etc/sysctl.d/99-tailscale.conf
sysctl -p /etc/sysctl.d/99-tailscale.conf
# udp forwarding
printf '#!/bin/sh\n\nethtool -K %s rx-udp-gro-forwarding on rx-gro-list off \n' "$(ip -o route get 8.8.8.8 | cut -f 5 -d " ")" | tee /etc/networkd-dispatcher/routable.d/50-tailscale
chmod 755 /etc/networkd-dispatcher/routable.d/50-tailscale
# tailscale curl script
curl -fsSL https://tailscale.com/install.sh | sh
# log in and up
tailscale up --advertise-routes $ip_range --advertise-exit-node

56
dist-upgrade.sh Normal file
View File

@ -0,0 +1,56 @@
#!/bin/bash
#get a list and work on all of them in paralel
# Master updater
# get list of containers ranges
# fork script to run in conteiner (slave)
# run slave
# Slave updater
# rootfs /var/lib/lxc/$conteiner_id/rootfs/
printf "What conteiner next?\n"
read conteiner_id
fun_update($conteiner_id) {
pct enter $conteiner_id
apt update -y
apt dist-upgrade -y
#change bookworm to trixie in /etc/apt/
sed -i "s/bookworm/trixie/g" /etc/apt/sources.list
sed -i "s/bookworm/trixie/g" /etc/apt/sources.list.d/*
apt update -y
apt dist-upgrade -y
#it show a lot of info what to do with it TODO?
# a lot of defaluts
exit
}
if [[ conteiner_id =~ ^[0-9]+$ ]]; then
printf "Doing my part\n"
fun_update($conteiner_id)
else
printf "Sorry what?\n"
fi
printf "Do you want to continue? (Y/n):\n"
read next
if [[ $next =~ ("N"|"n") ]]; then
printf "Thx gl \n"
else
printf "ok, next round is coming\n"
./dist-upgrade.sh
fi