sudo apt-get update && sudo apt-get upgrade
sudo apt install docker.io -y
sudo systemctl enable --now docker
systemctl restart docker.service
#!/bin/bash
#check docker cmd
which docker >/dev/null 2>&1
if [ $? -ne 0 ] ; then
echo "docker not found, please install first!"
echo "ubuntu:sudo apt install docker.io -y"
echo "centos:yum install -y docker-ce "
echo "fedora:sudo dnf install -y docker-ce"
exit
fi
#check docker service
docker ps > /dev/null 2>&1
if [ $? -ne 0 ] ; then
echo "docker service is not running! you can use command start it:"
echo "sudo service docker start"
exit
fi
docker stop wormholes > /dev/null 2>&1
docker rm wormholes > /dev/null 2>&1
docker rmi wormholestech/wormholes:v1 > /dev/null 2>&1
if [ -d /wm/.wormholes/keystore ]; then
read -p "Whether to clear the Wormholes blockchain data history, if yes, press the “y” button, and if not, click “enter.”:" xyz
if [ "$xyz" = 'y' ]; then
rm -rf /wm/.wormholes
read -p "Enter your private key:" ky
else
echo "Do not clear"
fi
else
read -p "Please import your private key:" ky
fi
mkdir -p /wm/.wormholes/wormholes
if [ -n "$ky" ]; then
echo $ky > /wm/.wormholes/wormholes/nodekey
fi
docker run -id -e KEY=$ky -p 30303:30303 -p 8545:8545 -v /wm/.wormholes:/wm/.wormholes --name wormholes wormholestech/wormholes:v1
echo "Your private key is:"
sleep 6
docker exec -it wormholes /usr/bin/cat /wm/.wormholes/wormholes/nodekey