Upload files

Signed-off-by: Lev Rusanov <30170278+JDM170@users.noreply.github.com>
This commit is contained in:
2025-08-12 23:12:26 +07:00
parent 94a6b86de6
commit 85f50360b2
3 changed files with 68 additions and 0 deletions

24
init.sh Normal file
View File

@@ -0,0 +1,24 @@
#!/bin/bash
find /etc/amnezia/amneziawg -mindepth 1 -delete
COUNTER=0
for s in $(find /config -name "*.conf")
do
if test -f ${s}
then
COUNTER=$(( COUNTER + 1 ))
basename=$(basename ${s})
name=${basename%.conf}
echo awg interface "${name}" will be created from config file "${basename}"
cp ${s} /etc/amnezia/amneziawg/${name}.conf
chmod 600 /etc/amnezia/amneziawg/${name}.conf
awg-quick up ${name}
iptables -A FORWARD -i ${name} -j ACCEPT
iptables -A FORWARD -o ${name} -j ACCEPT
iptables -A FORWARD -i ${name} -o ${name} -j ACCEPT
fi
done
if [[ $COUNTER -lt 1 ]]
then
echo "There are no config files in the /config folder"
fi