summaryrefslogtreecommitdiff
path: root/osx/generate.py
diff options
context:
space:
mode:
Diffstat (limited to 'osx/generate.py')
-rw-r--r--osx/generate.py20
1 files changed, 17 insertions, 3 deletions
diff --git a/osx/generate.py b/osx/generate.py
index aec4ea9..b9248cb 100644
--- a/osx/generate.py
+++ b/osx/generate.py
@@ -41,6 +41,9 @@ INFO_PLIST = APP_PATH + '/Contents/Info.plist'
HELPER_PLIST = os.path.join(SCRIPTS, 'se.leap.bitmask-helper.plist')
PREINSTALL = os.path.join(SCRIPTS, 'preinstall')
POSTINSTALL = os.path.join(SCRIPTS, 'postinstall')
+RULEFILE = os.path.join(here, 'bitmask.pf.conf')
+VPN_UP = os.path.join(here, 'client.up.sh')
+VPN_DOWN = os.path.join(here, 'client.down.sh')
os.makedirs(APP_PATH + "/Contents/MacOS", exist_ok=True)
os.makedirs(APP_PATH + "/Contents/Resources", exist_ok=True)
@@ -115,8 +118,19 @@ generate_from_template(TEMPLATE_HELPER, HELPER_PLIST, vardict)
generate_from_template(TEMPLATE_PREINSTALL, PREINSTALL, vardict)
generate_from_template(TEMPLATE_POSTINSTALL, POSTINSTALL, vardict)
+# 6. Copy helper pf rule file
+# ------------------------------------------------
-# 6. Generate uninstall script
+shutil.copy(RULEFILE, APP_PATH + '/Contents/helper/')
+
+# 7. Copy openvpn up/down scripts
+# ------------------------------------------------
+
+shutil.copy(VPN_UP, APP_PATH + '/Contents/helper/')
+shutil.copy(VPN_DOWN, APP_PATH + '/Contents/helper/')
+
+
+# 8. Generate uninstall script
# -----------------------------------------------
# TODO copy the uninstaller script from bitmask-dev
# TODO substitute vars
@@ -126,6 +140,6 @@ generate_from_template(TEMPLATE_POSTINSTALL, POSTINSTALL, vardict)
# always reference there.
-# We're all set here
-# ------------------
+# We're all set!
+# -----------------------------------------------
print("[+] Output written to dist/{appname}.app".format(appname=APP_NAME))