summarylogtreecommitdiffstats
path: root/ergo-node
blob: 2fc2abb054a25a813f776dadd2950cb7badedca2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/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 "$@"