set -eu
-# set chain data dir
-if [[ -z "${V_CHAIN_DATA_DIR-}" ]]; then
- if [[ "$OSTYPE" == "darwin"* ]]; then
- V_CHAIN_DATA_DIR="$HOME/Library/Application Support/Komodo/VRSC"
+function set_data_dir() {
+ echo Enter blockchain data directory or leave blank for default:
+ read -r vrsc_data_dir
+ if [[ "$vrsc_data_dir" == "" ]]; then
+ if [[ "$OSTYPE" == "darwin"* ]]; then
+ V_CHAIN_DATA_DIR="$HOME/Library/Application Support/Komodo/VRSC"
+ else
+ V_CHAIN_DATA_DIR="$HOME/.komodo/VRSC"
+ fi
else
- V_CHAIN_DATA_DIR="$HOME/.komodo/VRSC"
+ V_CHAIN_DATA_DIR="$vrsc_data_dir"
fi
+}
+
+# set chain data dir
+if [[ -z "${V_CHAIN_DATA_DIR-}" ]]; then
+ set_data_dir
fi
BOOTSTRAP_URL="https://bootstrap.veruscoin.io"
function fetch_bootstrap() {
echo Fetching bootstrap
-
for method in wget curl failure; do
if "fetch_$method" "$BOOTSTRAP_ARCHIVE" "/tmp/$BOOTSTRAP_ARCHIVE" "${BOOTSTRAP_URL}"; then
echo "Download successful!"
rm /tmp/$BOOTSTRAP_ARCHIVE_SIG
rm /tmp/$BOOTSTRAP_ARCHIVE
fi
-
}
function main() {
fetch_bootstrap
break
;;
- No) echo bootstrap not installed && exit 1;;
+ No) echo bootstrap not installed && exit 1 ;;
esac
done
fi