modified main script to output into subdir

added gitignore

forgot to exclude the gitignore from gitignore so yeah...
This commit is contained in:
Stephen Toth 2023-09-02 20:01:45 -05:00
parent 01eb0f54df
commit 914833c7b8
2 changed files with 9 additions and 2 deletions

4
.gitignore vendored Normal file
View File

@ -0,0 +1,4 @@
0*
client-*
!0*.def
!1*

View File

@ -1,5 +1,7 @@
#!/bin/ash
OutputDir="clients/"
EnvironmentFile="0connection-info.env"
echo "[*] Using server information from file \"$EnvironmentFile\""
if [ ! -f "$EnvironmentFile" ]
@ -16,6 +18,7 @@ read Ip
umask 077;
cd "clients"
wg genkey | tee "client-$Name" | wg pubkey > "client-$Name.pub"; wg genpsk > "client-$Name.psk";
echo "[*] Generated Keys"
@ -43,8 +46,8 @@ PublicKey = $(cat "client-$Name.pub")
PresharedKey = $(cat "client-$Name.psk")
AllowedIPs = "$Ip/32"
EOF
echo;
echo "[*] Generated server lines and outputed to file \"client-$Name.srv\""
echo "[*] Generated server lines and outputed to file \"${OutputDir}client-$Name.srv\""
cd ..
umask 022;
echo "[*] All done!"