commit d2ec804aa283c2619e99e3470076e79c79d87b12 Author: ggodot Date: Wed Dec 31 14:32:28 2025 +0100 staring diff --git a/bridge.sh b/bridge.sh new file mode 100644 index 0000000..9094852 --- /dev/null +++ b/bridge.sh @@ -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 diff --git a/dist-upgrade.sh b/dist-upgrade.sh new file mode 100644 index 0000000..9bb571b --- /dev/null +++ b/dist-upgrade.sh @@ -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 +