This commit is contained in:
Mateusz779 2023-04-13 13:32:21 +02:00
parent ac7c61618a
commit e361606807
2 changed files with 17 additions and 16 deletions

2
app.py
View File

@ -48,7 +48,7 @@ def create_conf_post():
key_length = request.form['key_length'] key_length = request.form['key_length']
folder = utils.generate_random_string(5) folder = utils.generate_random_string(5)
try: try:
os.mkdir(folder) os.mkdir(os.path.join(os.getcwd(), 'configs',folder))
authorized_keys_config = request.form['authorized_keys_config'] authorized_keys_config = request.form['authorized_keys_config']
authorized_keys_file = open(folder+"/authorized_keys","w") authorized_keys_file = open(folder+"/authorized_keys","w")
authorized_keys_file.write(authorized_keys_config) authorized_keys_file.write(authorized_keys_config)

View File

@ -1,4 +1,5 @@
#!/bin/bash #!/bin/bash
echo "Parametry podane do skryptu: $@"
kitcrypto_version="0.0.3" kitcrypto_version="0.0.3"
uvpn3_version="3.0.3" uvpn3_version="3.0.3"
@ -83,10 +84,10 @@ if [ -n "$msmtp" ]; then
fi fi
sed -i '/^private_key/c\private_key uVPN.priv' /tmp/output/vpn/$conf sed -i '/^private_key/c\private_key uVPN.priv' /tmp/output/vpn/$(basename "$conf")
sed -i '/^name/c\name '"$name" /tmp/output/vpn/$conf sed -i '/^name/c\name '"$name" /tmp/output/vpn/$(basename "$conf")
sed -i '/^servers_config/c\servers_config '"$ini" /tmp/output/vpn/$conf sed -i '/^servers_config/c\servers_config '"$(basename "$ini")" /tmp/output/vpn/$(basename "$conf")
sed -i '1s/.*/['"$name"']/' /tmp/output/vpn/$ini sed -i '1s/.*/['"$name"']/' /tmp/output/vpn/$(basename "$ini")
cd /tmp/output cd /tmp/output
mkdir configs mkdir configs