diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..5a27e61 --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +0* +client-* +!0*.def +!1* diff --git a/1genconfig.sh b/1genconfig.sh index 6c46396..6a7a9b5 100755 --- a/1genconfig.sh +++ b/1genconfig.sh @@ -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!"