tasks queue

This commit is contained in:
bogale 2026-09-26 01:48:54 +09:00
commit 0383cfd0d8
7 changed files with 30 additions and 21 deletions

20
data/action.sh Executable file
View file

@ -0,0 +1,20 @@
#!/usr/bin/bash
set -euo pipefail
if [ ! -e state ]; then
echo 0 > state
fi
case "$(cat state)" in
0)
./data/setup.sh
;;
1)
./data/install.sh
;;
2)
echo Installed in $(($(date +%s)-$(cat start)))s
rm -r *
exit
esac
echo "$((1+$(cat state)))" > state
reboot
exit 1

View file

@ -1,10 +1,6 @@
#!/usr/bin/bash
set -euo pipefail
. data/vps.env
export DEBIAN_FRONTEND=noninteractive
apt-get install -y software-properties-common python3-launchpadlib gnupg2 linux-headers-$(uname -r)
add-apt-repository -y ppa:amnezia/ppa
apt-get install -y amneziawg amneziawg-tools iptables-persistent
. data/dest.env
cat <<EOF >> /etc/sysctl.conf
net.ipv4.ip_forward = 1
net.ipv4.conf.all.forwarding = 1
@ -24,12 +20,10 @@ for route in tcp:25 tcp:80 tcp:443 udp:443; do
ip6tables -t nat -A PREROUTING -m addrtype --dst-type LOCAL -p $PROTO --dport $PORT -j DNAT --to-destination [$DEST6]:$PORT
ip6tables -A FORWARD -d $DEST6 -p $PROTO --dport $PORT -j ACCEPT
done
netfilter-persistent save
export DEBIAN_FRONTEND=noninteractive
add-apt-repository -y ppa:amnezia/ppa
apt-get install -y software-properties-common python3-launchpadlib gnupg2 linux-headers-$(uname -r) amneziawg amneziawg-tools iptables-persistent
mv data/awg0.conf /etc/amnezia/amneziawg
systemctl enable awg-quick@awg0
apt-get autoremove --purge -y
apt-get clean
echo Installed in $(($(date +%s)-$(cat start)))s
rm -r *
reboot
exit

View file

@ -11,5 +11,3 @@ echo "/var/swapfile none swap defaults 0 0" >> /etc/fstab
export DEBIAN_FRONTEND=noninteractive
apt-get update
apt-get dist-upgrade -y -o Dpkg::Options::="--force-confold"
reboot
exit