2018-10-01 21:01:32 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
2018-10-01 21:33:17 +00:00
|
|
|
sleep 1 # prevent cpu spike on looping
|
|
|
|
|
2018-10-01 21:01:32 +00:00
|
|
|
export IPFS="/usr/local/bin/ipfs"
|
|
|
|
export HOME="/home/ipfs"
|
2018-10-01 21:20:50 +00:00
|
|
|
chown ipfs:ipfs $HOME
|
2018-10-01 21:01:32 +00:00
|
|
|
cd $HOME
|
|
|
|
|
2018-10-01 22:27:41 +00:00
|
|
|
export IPFS_PATH=/var/lib/ipfs
|
2018-10-01 22:12:11 +00:00
|
|
|
|
2018-10-01 22:27:41 +00:00
|
|
|
if [[ ! -d $IPFS_PATH ]]; then
|
|
|
|
mkdir -p $IPFS_PATH
|
|
|
|
chown ipfs:ipfs $IPFS_PATH
|
2018-10-01 22:49:56 +00:00
|
|
|
chpst -u ipfs $IPFS init --profile=badgerds
|
2018-10-01 21:20:50 +00:00
|
|
|
fi
|
|
|
|
|
2018-10-01 21:01:32 +00:00
|
|
|
exec chpst -u ipfs $IPFS daemon
|