2019-04-23 22:18:41 +00:00
|
|
|
#!/bin/sh
|
|
|
|
echo "Running postinstall" > /tmp/lokinet_postinstall.log
|
|
|
|
|
|
|
|
RED='\033[0;31m'
|
|
|
|
GREEN='\033[0;32m'
|
|
|
|
NC='\033[0m' # No Color
|
|
|
|
|
|
|
|
rm $HOME/.lokinet/*.signed >> /tmp/lokinet_postinstall.log
|
|
|
|
rm $HOME/.lokinet/*.key >> /tmp/lokinet_postinstall.log
|
|
|
|
rm $HOME/.lokinet/*.private >> /tmp/lokinet_postinstall.log
|
|
|
|
rm -fr $HOME/.lokinet/netdb >> /tmp/lokinet_postinstall.log
|
|
|
|
|
2019-10-29 07:20:11 +00:00
|
|
|
/usr/local/bin/lokinet -g >> /tmp/lokinet_postinstall.log
|
|
|
|
|
2019-09-05 01:42:37 +00:00
|
|
|
url="https://seed.lokinet.org/bootstrap.signed"
|
2019-04-23 22:18:41 +00:00
|
|
|
echo "downloading $url" >> /tmp/lokinet_postinstall.log
|
|
|
|
echo "to $HOME/.lokinet/bootstrap.signed" >> /tmp/lokinet_postinstall.log
|
|
|
|
|
|
|
|
# use temp file to not overrwrite existing bootstrap file on fail
|
|
|
|
tmp=/tmp/bootstrap.tmp
|
|
|
|
|
|
|
|
# MacOS does not have wget without homebrew but does have curl
|
|
|
|
# Rick also had indicated most BSDs have curl too
|
|
|
|
curl "$url" > "$tmp" && \
|
|
|
|
(mv "$tmp" "$HOME/.lokinet/bootstrap.signed" && echo "${GREEN}lokinet successfully bootstrapped${NC}" >> /tmp/lokinet_postinstall.log) \
|
|
|
|
|| echo "${RED}failed to download bootstrap from $url${NC}" >> /tmp/lokinet_postinstall.log
|
|
|
|
rm -f "$tmp"
|
|
|
|
|
|
|
|
exit 0 # all good
|