kubo/bin/container_daemon
kpcyrd 9317649c33 Dockerfile: Remove 2 year old deprecation warning
License: MIT
Signed-off-by: kpcyrd <git@rxv.cc>
2019-04-05 14:10:00 +02:00

30 lines
647 B
Bash
Executable File

#!/bin/sh
set -e
user=ipfs
repo="$IPFS_PATH"
if [ `id -u` -eq 0 ]; then
echo "Changing user to $user"
# ensure folder is writable
su-exec "$user" test -w "$repo" || chown -R -- "$user" "$repo"
# restart script with new privileges
exec su-exec "$user" "$0" "$@"
fi
# 2nd invocation with regular user
ipfs version
if [ -e "$repo/config" ]; then
echo "Found IPFS fs-repo at $repo"
else
case "$IPFS_PROFILE" in
"") INIT_ARGS="" ;;
*) INIT_ARGS="--profile=$IPFS_PROFILE" ;;
esac
ipfs init $INIT_ARGS
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 "$@"