github.com/keltia/go-ipfs@v0.3.8-0.20150909044612-210793031c63/bin/container_daemon (about) 1 #!/bin/bash 2 3 # Test whether the mounted directory is writable for us 4 if ( touch /data/ipfs/write_test 2>/dev/null ); then 5 rm /data/ipfs/write_test 6 else 7 echo "ERR: /data/ipfs is not writable for user 'ipfs' (UID 1000)" 8 exit 1 9 fi 10 11 echo "Running $(ipfs version)..." 12 13 if [ -e /data/ipfs/config ]; then 14 echo "Found ipfs repository. Not initializing." 15 else 16 ipfs init 17 ipfs config Addresses.API /ip4/0.0.0.0/tcp/5001 18 ipfs config Addresses.Gateway /ip4/0.0.0.0/tcp/8080 19 fi 20 21 ipfs daemon