Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 19 additions & 4 deletions scripts/oneline.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
set -e

# if no arguments are provided, return usage function
if [ $# -ne 2 ]; then
echo 1>&2 "Usage: $0 <data-dir> <name>"
if [ $# -lt 2 ]; then
echo 1>&2 "Usage: $0 <data-dir> <name> [version]"
exit 3
fi

Expand Down Expand Up @@ -50,8 +50,23 @@ else
exit 1
fi

if [ ! -z "$3" ]; then
# echo "Choose your version, available versions:"
# standardVer=`curl --silent "https://api.github.com/repos/digitalnativeinc/standard-substrate/releases" | grep '"tag_name":'`
# while IFS=',' read -ra ADDR; do
# for i in "${ADDR[@]}"; do
# # process "$i"
# echo $i | cut -d " " -f2- | sed 's/"//g'
# done
# done <<< "$standardVer"
# read -p "Version: " LATEST_RELEASE
LATEST_RELEASE=$3
else
LATEST_RELEASE=`curl --silent "https://api.github.com/repos/digitalnativeinc/standard-substrate/releases/latest" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/'`
fi

# pulls latest release tag and sets it as var
LATEST_RELEASE=`curl --silent "https://api.github.com/repos/digitalnativeinc/standard-substrate/releases/latest" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/'`
# LATEST_RELEASE=`curl --silent "https://api.github.com/repos/digitalnativeinc/standard-substrate/releases/latest" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/'`

wget -O opportunity-standalone https://github.com/digitalnativeinc/standard-substrate/releases/download/$LATEST_RELEASE/opportunity-standalone-linux-x86_64

Expand Down Expand Up @@ -95,4 +110,4 @@ $MAKE_ME_ROOT systemctl enable standard-validator
$MAKE_ME_ROOT systemctl start standard-validator

# check status of the service
$MAKE_ME_ROOT systemctl status standard-validator
$MAKE_ME_ROOT systemctl status standard-validator