macos post install script that bootstraps, generates configs and registers plist

This commit is contained in:
Jeff Becker 2020-04-10 15:17:11 -04:00 committed by Jason Rhinelander
parent 5b1941222b
commit 31f74b5ffb
2 changed files with 11 additions and 0 deletions

View File

@ -1,3 +1,4 @@
# macos specific cpack stuff goes here
set(CPACK_GENERATOR "productbuild")
set(CPACK_PACKAGING_INSTALL_PREFIX "/usr/local")
set(CPACK_POSTFLIGHT_LOKINET_SCRIPT ${CMAKE_SOURCE_DIR}/contrib/macos/postinstall)

10
contrib/macos/postinstall Normal file
View File

@ -0,0 +1,10 @@
#!/bin/sh
# set up lokinet data dir
[ -e /var/lib/lokinet/ ] || mkdir /var/lib/lokinet
# bootstrap
/usr/local/bin/lokinet-bootstrap mainnet /var/lib/lokinet/bootstrap.signed
# generate configs
/usr/local/bin/lokinet -g /var/lib/lokinet/lokinet.ini
# register with launchd
launchctl load /Library/LaunchDaemons/network.loki.lokinet.daemon.plist