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