ipfs-ubuntu-mirror/ipfsd.run

23 lines
449 B
Plaintext
Raw Normal View History

2018-10-01 21:01:32 +00:00
#!/bin/bash
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
fi
if [[ ! -e $IPFS_PATH/config ]]; then
2018-10-01 22:49:56 +00:00
chpst -u ipfs $IPFS init --profile=badgerds
chpst -u ipfs $IPFS config Datastore.StorageMax "4000GB"
2018-10-01 21:20:50 +00:00
fi
2018-10-01 21:01:32 +00:00
exec chpst -u ipfs $IPFS daemon