ipfs-ubuntu-mirror/ipfsd.run

25 lines
473 B
Bash

#!/bin/bash
sleep 1 # prevent cpu spike on looping
export IPFS="/usr/local/bin/ipfs"
export HOME="/var/lib/ipfs"
chown ipfs:ipfs $HOME
cd $HOME
export IPFS_PATH=/var/lib/ipfs
if [[ ! -d $IPFS_PATH ]]; then
mkdir -p $IPFS_PATH
fi
chown ipfs:ipfs $IPFS_PATH
if [[ ! -e $IPFS_PATH/config ]]; then
chpst -u ipfs $IPFS init --profile=badgerds
chpst -u ipfs $IPFS config Datastore.StorageMax "4000GB"
fi
export IPFS_FD_MAX=4096
exec chpst -u ipfs $IPFS daemon