about summary refs log tree commit diff
path: root/chainloader.sh
diff options
context:
space:
mode:
authormaride <maride@darknebu.la>2018-08-22 13:53:25 +0200
committermaride <maride@darknebu.la>2018-08-22 13:53:25 +0200
commitf8170053c19a9974d7a0f0e906c4832ee134d5c8 (patch)
tree94c8ac23816a99f89cff672040d7d3fe45d617ce /chainloader.sh
Init: working setup
Diffstat (limited to 'chainloader.sh')
-rw-r--r--chainloader.sh17
1 files changed, 17 insertions, 0 deletions
diff --git a/chainloader.sh b/chainloader.sh
new file mode 100644
index 0000000..15fee02
--- /dev/null
+++ b/chainloader.sh
@@ -0,0 +1,17 @@
+#!/bin/sh
+
+if [ "$action" == "generate" ]; then
+    # Generate PSK
+    openvpn --genkey --secret /prod/persist/static.key
+
+    # Generate client.conf
+    cat /prod/client.conf
+    echo "<secret>"
+    cat /prod/persist/static.key
+    echo "</secret>"
+fi
+
+if [ "$action" == "run" ]; then
+    openvpn --config /prod/server.conf
+fi
+