From c07f99a16643547640ac420cc8ff429e5f4691e7 Mon Sep 17 00:00:00 2001 From: Mateusz779 Date: Fri, 7 Apr 2023 09:46:07 +0200 Subject: [PATCH] - --- app.py | 2 +- configs/create.sh | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app.py b/app.py index 6983e65..c2f2d7f 100644 --- a/app.py +++ b/app.py @@ -4,4 +4,4 @@ app = Flask(__name__) @app.route("/api/getvpn") def hello_world(): - return send_file("praktyki.squashfs") \ No newline at end of file + return send_file("configs/squash/praktyki.squashfs") \ No newline at end of file diff --git a/configs/create.sh b/configs/create.sh index ce73542..bc7908c 100755 --- a/configs/create.sh +++ b/configs/create.sh @@ -53,9 +53,8 @@ cd $CONFIGS cp $conf /tmp/output cp $ini /tmp/output cp $key /tmp/output -if [ "$scripts" ]; then - echo "Podano parametr." - cp -r $scripts /tmp/output/ +if [ -n "$scripts" ]; then + cp -r $scripts /tmp/output/ fi sed -i '/^private_key/c\private_key uVPN.priv' /tmp/output/$conf sed -i '/^name/c\name '"$name" /tmp/output/$conf @@ -65,7 +64,8 @@ sed -i '1s/.*/['"$name"']/' /tmp/output/$ini cd /tmp/output mkdir vpn mv * vpn -mkdir $CONFIGS/squash/$name +mkdir -t $CONFIGS/squash +mkdir -t $CONFIGS/squash/$name mksquashfs . $CONFIGS/squash/$name.squashfs cp /tmp/output/vpn/$name.pub $CONFIGS/squash/$name