Skip to content

Commit

Permalink
Added rpcenabled flag in script
Browse files Browse the repository at this point in the history
  • Loading branch information
Swiftyos committed Nov 18, 2021
1 parent 9d629e9 commit 1f0781b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
6 changes: 6 additions & 0 deletions scripts/minima_service.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ HOME="/home/minima"
CONNECTION_HOST=''
CONNECTION_PORT=''
SLEEP=''
RPC=''

print_usage() {
printf "Usage: Setups a new minima service for the specified port, default 9121 \n \t -c REQUIRED connection host and port HOST:PORT \n \t -u flag Use unsecure p2p version with rpc ports active, ignored if -a isn't also set \n \t -x flag enable clean flag \n \t -p minima port to use eg. -p 9121 \n \t -h minima home directory eg -h /home/minima \n \t -a use the p2p alphas \n"
Expand All @@ -18,6 +19,7 @@ while getopts ':xsc::p:d:h:' flag; do
case "${flag}" in
s) SLEEP='true';;
x) CLEAN_FLAG='true';;
r) RPC='true';;
c) CONNECTION_HOST=$(echo $OPTARG | cut -f1 -d:);
CONNECTION_PORT=$(echo $OPTARG | cut -f2 -d:);;
p) PORT="${OPTARG}";;
Expand Down Expand Up @@ -97,6 +99,10 @@ if [ $HOST ]; then
MINIMA_PARAMS="$MINIMA_PARAMS -host $HOST"
fi

if [ $RPC ]; then
MINIMA_PARAMS="$MINIMA_PARAMS -rpcenable"
fi

tee <<EOF >/dev/null /etc/systemd/system/minima_$PORT.service
[Unit]
Description=minima_$PORT
Expand Down
4 changes: 3 additions & 1 deletion scripts/minima_setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,17 @@ HOME="/home/minima"
CONNECTION_HOST=''
CONNECTION_PORT=''
SLEEP=''
RPC=''

print_usage() {
printf "Usage: Setups a new minima service for the specified port, default 9121 \n \t -c REQUIRED connection host and port HOST:PORT \n \t -u flag Use unsecure p2p version with rpc ports active \n \t -x flag enable clean flag \n \t -p minima port to use eg. -p 9121 \n \t -h minima home directory eg -h /home/minima \n \t -a use the p2p alphas \n"
}

while getopts ':xsc::p:d:h:' flag; do
while getopts ':xrsc::p:d:h:' flag; do
case "${flag}" in
s) SLEEP='true';;
x) CLEAN_FLAG='true';;
r) RPC='true';;
c) CONNECTION_HOST=$(echo $OPTARG | cut -f1 -d:);
CONNECTION_PORT=$(echo $OPTARG | cut -f2 -d:);;
p) PORT="${OPTARG}";;
Expand Down

0 comments on commit 1f0781b

Please sign in to comment.