mirror of
https://github.com/oxen-io/lokinet.git
synced 2024-11-19 09:25:28 +00:00
b18546086a
* macos fluff * make uninstaller work, the uninstall script needs to be called with /usr/bin/sudo to work because god know why it needs that even though it's already root. * add logrotation * make the uninstall script kill all the things * revert * use correct regular expression * remove logrotate configs rename logrotate config file name to be more descriptive
39 lines
1.3 KiB
Bash
39 lines
1.3 KiB
Bash
#!/bin/sh
|
|
|
|
PERMS_OWNER=root
|
|
PERMS_GROUP=admin
|
|
CHOWN=$PERMS_OWNER:$PERMS_GROUP
|
|
|
|
# set up lokinet data dir
|
|
[ -e /var/lib/lokinet/ ] || mkdir /var/lib/lokinet
|
|
chown $CHOWN /var/lib/lokinet
|
|
chmod g+w /var/lib/lokinet
|
|
|
|
# mv files copied into $INSTALL_PREFIX/extra/ to their proper locations
|
|
mv /opt/lokinet/extra/lokinet_macos_daemon_script.sh /var/lib/lokinet
|
|
chown $CHOWN /var/lib/lokinet/lokinet_macos_daemon_script.sh
|
|
chmod 770 /var/lib/lokinet/lokinet_macos_daemon_script.sh
|
|
|
|
mv /opt/lokinet/extra/network.loki.lokinet.daemon.plist /Library/LaunchDaemons/
|
|
chown $CHOWN /Library/LaunchDaemons/network.loki.lokinet.daemon.plist
|
|
chmod 640 /Library/LaunchDaemons/network.loki.lokinet.daemon.plist
|
|
|
|
mv /opt/lokinet/extra/lokinet-newsyslog.conf /etc/newsyslog.d/lokinet.conf
|
|
chown $CHOWN /etc/newsyslog.d/lokinet.conf
|
|
chmod 640 /etc/newsyslog.d/lokinet.conf
|
|
|
|
# clean up by removing 'extra/' (so long as it's empty)
|
|
rmdir /opt/lokinet/extra/
|
|
|
|
# bootstrap
|
|
/opt/lokinet/bin/lokinet-bootstrap mainnet /var/lib/lokinet/bootstrap.signed
|
|
chown $CHOWN /var/lib/lokinet/bootstrap.signed
|
|
|
|
# generate configs
|
|
/opt/lokinet/bin/lokinet -g /var/lib/lokinet/lokinet.ini
|
|
chown $CHOWN /var/lib/lokinet/lokinet.ini
|
|
|
|
# register with launchd and start
|
|
launchctl load /Library/LaunchDaemons/network.loki.lokinet.daemon.plist
|
|
launchctl start network.loki.lokinet.daemon
|