ipfs-ubuntu-mirror/ipfsd.run

19 lines
346 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
chpst -u ipfs $IPFS init --profile=badgerds
fi
exec chpst -u ipfs $IPFS daemon