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.sh22
1 files changed, 10 insertions, 12 deletions
diff --git a/chainloader.sh b/chainloader.sh
index 15fee02..98558b2 100644
--- a/chainloader.sh
+++ b/chainloader.sh
@@ -1,17 +1,15 @@
 #!/bin/sh
 
-if [ "$action" == "generate" ]; then
-    # Generate PSK
-    openvpn --genkey --secret /prod/persist/static.key
+# 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
+# Generate client.conf
+cat /prod/client.conf > /tmp/client.conf
+echo "<secret>" >> /tmp/client.conf
+cat /prod/persist/static.key >> /tmp/client.conf
+echo "</secret>" >> /tmp/client.conf
 
-if [ "$action" == "run" ]; then
-    openvpn --config /prod/server.conf
-fi
+./confhost &
+
+openvpn --config /prod/server.conf