Skip to content
Snippets Groups Projects
Commit 97ca4a7d authored by 1nv1's avatar 1nv1
Browse files

Added the detection of docker or podman to start the node

parent 9d617104
No related branches found
No related tags found
No related merge requests found
#!/bin/bash #!/bin/bash
trap 'exit 1' ERR trap 'exit 1' ERR
flag_exit=0
res='fail'
cmd=''
if ! which docker > /dev/null 2>&1 detect_cmd()
then {
echo 'Can not find Docker. Make sure it is installed.' >&2 if which $1 > /dev/null 2>&1; then
cmd=$1
res='success'
fi
}
detect_cmd 'podman'
detect_cmd 'docker'
if [[ $res = 'fail' ]]; then
echo 'Can not find any command to create containers (podman or docker).' >&2
exit 1 exit 1
fi fi
...@@ -24,14 +37,14 @@ else ...@@ -24,14 +37,14 @@ else
fi fi
# Run this just a single time. # Run this just a single time.
# Docker itself makes sure it autostarts if it crashes or the server reboots. # Command itself makes sure it autostarts if it crashes or the server reboots.
docker run \ $cmd run \
--detach \ --detach \
--restart=unless-stopped \ --restart=unless-stopped \
--memory 4g \ --memory 4g \
$mounts \ $mounts \
-p 8545:8545 \ -p 8545:8545 \
-p 8546:8546 \ -p 8546:8546 \
-p 30303:30303 \ -p 30303:30303 \
--name ${name} \ --name ${name} \
bfaar/nodo:${tag} bfaar/nodo:${tag}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment