1
0
mirror of https://github.com/ipfs/kubo.git synced 2025-10-25 02:16:56 +08:00
Files
kubo/bin/container_daemon
Knut Ahlers 1cdafc7146 Use exec to start IPFS daemon
This incorporates feedback from @RX14 in #1685 and might fix #1537 as the ipfs daemon would get the stop signal from the docker daemon... Maybe that way it stops in a cleaner manner...

License: MIT
Signed-off-by: Knut Ahlers <knut@ahlers.me>
2015-09-15 11:30:20 +02:00

22 lines
496 B
Bash

#!/bin/bash
# Test whether the mounted directory is writable for us
if ( touch /data/ipfs/write_test 2>/dev/null ); then
rm /data/ipfs/write_test
else
echo "ERR: /data/ipfs is not writable for user 'ipfs' (UID 1000)"
exit 1
fi
echo "Running $(ipfs version)..."
if [ -e /data/ipfs/config ]; then
echo "Found ipfs repository. Not initializing."
else
ipfs init
ipfs config Addresses.API /ip4/0.0.0.0/tcp/5001
ipfs config Addresses.Gateway /ip4/0.0.0.0/tcp/8080
fi
exec ipfs daemon