Rene Vergara A
b142028c9f
Final version includes : Option for starting GUI Option for starting RPC Server Option for starting expert mode
65 lines
1.6 KiB
Bash
Executable file
65 lines
1.6 KiB
Bash
Executable file
#!/bin/bash
|
|
ZFOLDER=~/Zenith
|
|
IMAGE_NAME=zenith-docker:0.7.0.0
|
|
|
|
EXPERTMODE="0"
|
|
RPCSERVER="0"
|
|
|
|
if [ $# -gt 0 ]; then
|
|
while [[ $# -gt 0 ]]; do
|
|
case $1 in
|
|
-e|--expert)
|
|
EXPERTMODE="1"
|
|
shift 2
|
|
break
|
|
;;
|
|
-r|--rpc)
|
|
RPCSERVER="1"
|
|
shift 2
|
|
break
|
|
;;
|
|
-h|--help)
|
|
echo
|
|
echo "======================================================"
|
|
echo "Zenith Full Node Wallet and RPC server "
|
|
echo "version 0.7.0.0"
|
|
echo "======================================================"
|
|
echo
|
|
echo "Usage: runzenith"
|
|
echo " runzenith -e|--expert"
|
|
echo " runzenith -r|--rpc"
|
|
echo "Decription"
|
|
echo " no params -> starts zenith GUI wallet"
|
|
echo " -e | --expert -> starts zenith in expert mode"
|
|
echo " -r | --rpc -> starts zenith's rpc server"
|
|
echo " -h | --help -> displays this screen"
|
|
echo
|
|
exit 0
|
|
;;
|
|
*)
|
|
echo "Unknown option: $1"
|
|
exit 1
|
|
;;
|
|
esac
|
|
done
|
|
fi
|
|
|
|
# Check if data folder exists
|
|
if [ ! -d "$ZFOLDER" ]; then
|
|
echo "Error starting Zenith image"
|
|
echo "Zenith configurtion and data folder ($ZFOLDER) does not exists."
|
|
echo "Aborting process..."
|
|
exit
|
|
fi
|
|
|
|
# Check if the image exists locally
|
|
if [[ "$(docker images -q $IMAGE_NAME 2> /dev/null)" == "" ]]; then
|
|
echo "Error starting Zenith image"
|
|
echo "Image $IMAGE_NAME not found locally."
|
|
echo "Aborting process..."
|
|
exit
|
|
fi
|
|
|
|
docker run --rm -it --mount src=$ZFOLDER,target=/home/zenusr/Zenith,type=bind --net=host --env DISPLAY=$DISPLAY --env EXPERT_MODE=$EXPERTMODE --env RPC_SERVER=$RPCSERVER $IMAGE_NAME
|
|
|
|
# End
|