#!/bin/sh # Ergo node normally writes all its data in the current working directory # This is a wrapper script to make Ergo node use Xdg base directories if [ -z $XDG_DATA_HOME ]; then DATA_DIR=~/.local/share/ergo-node else DATA_DIR=$XDG_DATA_HOME/ergo-node fi if [ -z $XDG_CONFIG_HOME ]; then CONFIG_DIR=~/.config/ergo-node else CONFIG_DIR=$XDG_CONFIG_HOME/ergo-node fi mkdir -p $DATA_DIR mkdir -p $CONFIG_DIR if ! [ -f $CONFIG_DIR/local.conf ]; then # Copy sample config file if the user hasn't created one cp /usr/share/ergo-node/local.conf.sample $CONFIG_DIR/local.conf fi cd $DATA_DIR java -jar /usr/share/ergo-node/ergo.jar --mainnet -c $CONFIG_DIR/local.conf "$@"