add new client

This commit is contained in:
Leon Vita 2022-09-02 03:33:10 +01:00
parent 6c3ba66af5
commit 62fafaa016
10 changed files with 41 additions and 22 deletions

2
IPS
View File

@ -4,7 +4,7 @@ ips=(
#server_ips:
"10.10.11.1/24" "10.10.100.1/24" "10.10.11.2/24"
#Client_ips:
"10.10.11.3/24"
"10.10.11.4/24"

Binary file not shown.

28
cat.py Executable file
View File

@ -0,0 +1,28 @@
#!/usr/bin/env python3
def cat_search():
print(""" ,-. _,---._ __ / \ """)
print(""" / ) .-' `./ / \ """)
print("""( ( ,' `/ /|""")
print(""" \ `-" \ \ / |""")
print(""" `. , \ \ / |""")
print(""" /`. ,'-`----Y |""")
print(""" ( ; cat | '""")
print(""" | ,-. ,-' search | /""")
print(""" | | ( | for IP | /""")
print(""" ) | \ `.___________|/""")
print(""" `--' `--" """"")
def cat_done():
print(""" /\ /|""")
print("""{ `---' }""")
print("""{ O O }""")
print(""""~~> V <~~""")
print(""" \ \|/ /""")
print(""" `-----'____""")
print(""" / \ \_""")
print(""" { }\ )_\_ _""")
print(""" | \_/ |/ / \_\_/ )""")
print(""" \__/ /(_/ \__/""")
print(""" (__/""")

18
gen.sh
View File

@ -2,7 +2,7 @@
source IPS
#--------------------Input---------------------
#--------------------Input-------------------
echo -e "File Name with:\r"
read file_name
echo -e "Please Put The Client Ip Address:\r"
@ -26,12 +26,14 @@ echo -ne '# (1%)\n'
sleep 1
#Checking IPS
echo "Checking.....";sleep 1
python3 -c 'import cat;cat.cat_search()'
check_ip () {
for ip in "${ips[@]}"
do
if [[ "$ip" == "$user_input" ]];then
echo "ip exist"
echo "Try Again !!"
echo "The Cat Found Existing IP."
checked= return 1
exit 0
fi
@ -46,6 +48,8 @@ check_ip () {
echo "Done generating config:"
mv $file_name config_file
mv "$file_name.png" qr-code
echo -ne '##########################(100%)\n'
python3 -c 'import cat;cat.cat_done()'
fi
}
echo -ne '##### (33%)\n'
@ -58,9 +62,7 @@ sleep 1
gen () {
#gen keys for Clinet:
wg genkey | tee privatekey | wg pubkey > publickey
#___________________________________________________
#Create file for config the clinet.
#Request Check Function From ips.sh
touch $file_name;echo "[Interface]" >> $file_name;echo "Address = $user_input" >> $file_name
echo "PrivateKey = $(cat privatekey)" >> $file_name
echo "$user_input = privatekey= $(cat privatekey) publickey= $(cat publickey)" >> user_info
@ -81,8 +83,6 @@ else
fi
echo -ne '################ (60%)\n'
sleep 1
echo "Adding peer......";sleep 2
@ -115,12 +115,14 @@ echo -ne '################### (70%)\n'
sleep 1
#---------------Done-Build------------------
#--------------Writing-New-Data-------------
sed -i '' '7i\'$'\n'' "'$user_input'" ' IPS
#--------------Done--Writing----------------
echo -ne '###################### (85%)\n'
sleep 1
#cleaning files
#--------------cleaning-files---------------
echo "Cleaning....";sleep 1
rm privatekey publickey
echo -ne '######################## (90%)\n'
@ -145,9 +147,7 @@ push (){
#---------------Call-Functions-----------------
check_ip
echo -ne '##########################(100%)\n'
#-----------------End--Call------------------
exit 0

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1022 B

View File

@ -1 +1 @@
10.10.11.3/24 = privatekey= qDtrTju57zk/1RgqyhvftIW5rkH95fKvO28RJ0r05HY= publickey= syL6M4NmFW9ibVaIEYGljlFO2t+s5M0WKnvx9Qqyq0I=
10.10.11.4/24 = privatekey= GGyRweYx6WbCB33Uck+t8qs3yfiCclWiI0HZWYLsIlY= publickey= xFBw/VvYtlym0NbHk+mDy2chcEW2SI/9NK+U5qrzN1k=

View File

@ -1,6 +1,6 @@
[Interface]
Address = 10.10.11.3/24
PrivateKey = qDtrTju57zk/1RgqyhvftIW5rkH95fKvO28RJ0r05HY=
Address = 10.10.11.4/24
PrivateKey = GGyRweYx6WbCB33Uck+t8qs3yfiCclWiI0HZWYLsIlY=
DNS = 10.10.11.1,8.8.8.8
[Peer]
PublicKey = w3qegSSuqFTFrGk4XJaWBSwGDOiqbnnAIR9MzwjYVA8=

BIN
vpn.conf.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

@ -1,9 +0,0 @@
[Interface]
Address = 10.10.11.3/24
PrivateKey = qDtrTju57zk/1RgqyhvftIW5rkH95fKvO28RJ0r05HY=
DNS = 10.10.11.1,8.8.8.8
[Peer]
PublicKey = w3qegSSuqFTFrGk4XJaWBSwGDOiqbnnAIR9MzwjYVA8=
Endpoint = 81.201.149.152:18800
AllowedIPs= 10.10.11.0/24
PersistentKeepalive = 25

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1022 B