ipfs-ubuntu-mirror/ipfsd.run

19 lines
323 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:12:11 +00:00
export IPFS_DIR=/var/lib/ipfs
if [[ ! -d $IPFS_DIR ]]; then
mkdir -p $IPFS_DIR
chown ipfs:ipfs $IPFS_DIR
2018-10-01 21:20:50 +00:00
chpst -u ipfs $IPFS init
fi
2018-10-01 21:01:32 +00:00
exec chpst -u ipfs $IPFS daemon