Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix ergo-installer.sh #1014

Merged
merged 1 commit into from
Dec 26, 2019
Merged
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
11 changes: 8 additions & 3 deletions ergo-installer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# Initialize all the option variables.
# This ensures we are not contaminated by variables from the environment.
APP_DIR=~/Ergo
APP_DIR=~/ergo
NODE_NAME=${USER}-$(hostname)
API_KEY=
DEBIAN_INSTALLATION_RECOMMENDATIONS=
Expand Down Expand Up @@ -47,7 +47,7 @@ while :; do
fi
;;
--app-dir=?*)
NODE_NAME=${1#*=} # Delete everything up to "=" and assign the remainder.
APP_DIR=${1#*=} # Delete everything up to "=" and assign the remainder.
;;
--app-dir=) # Handle the case of an empty --app-dir=
echo 'ERROR: "--app-dir" requires a non-empty option argument.'
Expand Down Expand Up @@ -107,6 +107,11 @@ while :; do
done

# Check required options
if [ "$(echo "${APP_DIR}" | cut -c1-1)" != "/" ]; then
echo 'ERROR: "--app-dir" requires absolute pathes only (path must start with "/"),' "${APP_DIR} given."
exit 1
fi

if [ -z "${API_KEY}" ]; then
echo 'ERROR: "--api-key" is required and requires a non-empty option argument.'
exit 1
Expand Down Expand Up @@ -146,7 +151,7 @@ if [ "${TOR}" != "no" ]; then
fi

if [ -n "${DEBIAN_INSTALLATION_RECOMMENDATIONS}" ]; then
echo "To run Ergo node as you desired, you first need to install required software. For Ubuntu, run:${DEBIAN_INSTALLATION_RECOMMENDATIONS}"
echo "To run Ergo node as you desired, you first need to install required software. For Debian (or Ubuntu), run:${DEBIAN_INSTALLATION_RECOMMENDATIONS}"
echo "After software installed, just run this script again with same parameters"
exit 1
fi
Expand Down