Skip to content
Snippets Groups Projects
Select Git revision
  • fe9f1335c8f6a087a5db0b19a358e325840e3c5e
  • master default protected
  • network/gtest-1000 protected
  • upgradable-multisig
  • runtime/gtest-1000
  • network/gdev-800 protected
  • cgeek/issue-297-cpu
  • gdev-800-tests
  • update-docker-compose-rpc-squid-names
  • fix-252
  • 1000i100-test
  • hugo/tmp-0.9.1
  • network/gdev-803 protected
  • hugo/endpoint-gossip
  • network/gdev-802 protected
  • hugo/distance-precompute
  • network/gdev-900 protected
  • tuxmain/anonymous-tx
  • debug/podman
  • hugo/195-doc
  • hugo/195-graphql-schema
  • gtest-1000-0.11.1 protected
  • gtest-1000-0.11.0 protected
  • gtest-1000 protected
  • gdev-900-0.10.1 protected
  • gdev-900-0.10.0 protected
  • gdev-900-0.9.2 protected
  • gdev-800-0.8.0 protected
  • gdev-900-0.9.1 protected
  • gdev-900-0.9.0 protected
  • gdev-803 protected
  • gdev-802 protected
  • runtime-801 protected
  • gdev-800 protected
  • runtime-800-bis protected
  • runtime-800 protected
  • runtime-800-backup protected
  • runtime-701 protected
  • runtime-700 protected
  • runtime-600 protected
  • runtime-500 protected
41 results

setup.md

Blame
  • duniter.sh 1.30 KiB
    #!/bin/bash
    
    ##########################
    #    DUNITER EXECUTABLE
    #
    # Wraps bin/duniter.js that is called with Node.js
    #
    
    DEB_PACKAGING=
    
    if [[ $DEB_PACKAGING ]]; then
      DUNITER_DIR=/opt/duniter/sources/
    fi
    
    duniter() {
    
    	local NODE
    	local LOGS_FILE
    
    	if [ -z "$DEV_MODE" ]; then
    
    		### Production mode
    		if [[ -d $DUNITER_DIR/node ]]; then
    			NODE=$DUNITER_DIR/node/bin/node
    	  else
    	    echo "Node.js is not embedded in this version of Duniter"
    	    return
    		fi;
    	else
    
    		### Cheating with DEV mode
    		DUNITER_DIR=`pwd`
    		NODE=node
    	fi
    
    	VERSION=`$NODE -v`
    
    	if [[ $VERSION != v6* && $VERSION != v5* && $VERSION != v4* ]]; then
    	  echo "$NODE v5 or v4 is required";
    	else
    
    		case "$1" in
    
    		#---------------------------------
    		#  DUNITER DAEMON MANAGEMENT
    		#---------------------------------
    
    		reset|start|stop|restart|webstart|webrestart)
    		$NODE "$DUNITER_DIR/bin/daemon" $*
    		;;
    
    		direct_start)
    		$NODE "$DUNITER_DIR/bin/duniter" start ${@:2}
    		;;
    
    		logs)
    		LOGS_FILE=`$NODE "$DUNITER_DIR/bin/daemon" $*`
    		tail -f -n 500 "$LOGS_FILE"
    		;;
    
    		#---------------------------------
    		#  DUNITER CLI COMMANDS
    		#---------------------------------
    
    		*)
    	  $NODE "$DUNITER_DIR/bin/duniter" "$@"
    		;;
    
    		esac
    	fi;
    }
    
    # If the script was launched with parameters, try to launch the Duniter command
    if [ ! -z $1 ]; then
    	duniter "$@"
    fi