about summary refs log tree commit diff
path: root/chainloader.sh
diff options
context:
space:
mode:
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
+