xmrig-bash-scripts/input.sh

62 lines
1.5 KiB
Bash
Raw Normal View History

2019-08-11 11:27:39 +03:00
#!/bin/bash
# Ask user questions
# Capture input
2019-08-11 16:58:07 +03:00
# if setting already exist use existing
2019-08-11 11:27:39 +03:00
2019-08-11 16:58:07 +03:00
echo -e "${_GREEN}USER SETTINGS STARTED${_RESET}"
2019-08-11 11:27:39 +03:00
if [ -f $_WORK_DIR/$_MYSETTINGS_FILE ]; then
# Call function
2019-08-11 16:58:07 +03:00
load_mysettings
my_config_json
2019-08-11 11:27:39 +03:00
else
2019-08-11 16:58:07 +03:00
echo -e " ${_YELLOW}Opt for default settings or enter your own.\n"
echo -e " No - 'config.json' created with values from 'settings.sh'."
echo -e " Yes - 'config.json' created with values from 'mysettings.sh' (recomended).\n"
echo -e " When 'mysettings.sh' exists this prompt will be skipped at furture installation."
echo -e " Own settings is recomended to avoid your settings being overidden in upgrades.${_RESET}\n"
2019-08-11 11:27:39 +03:00
prompt_confirm "Enter your own settings?"
if [ "$?" -eq 0 ]; then
# Create a file
touch $_MYSETTINGS_FILE_LOCATION
chmod +x $_MYSETTINGS_FILE_LOCATION
echo "#!/bin/bash" > $_MYSETTINGS_FILE_LOCATION
# Prompt user input
2019-08-13 18:33:36 +03:00
echo "Current pool URL: $_POOLS_URL"
read -p "Enter new pool URL: " _POOLS_URL
echo "_POOLS_URL=\"$_POOLS_URL\"" >> $_MYSETTINGS_FILE_LOCATION
2019-08-11 11:27:39 +03:00
2019-08-13 18:33:36 +03:00
echo "Current Receive Wallet address: $_POOLS_USER"
read -p "Enter new Receive Wallet address: " _POOLS_USER
echo "_POOLS_USER=\"$_POOLS_USER\"" >> $_MYSETTINGS_FILE_LOCATION
2019-08-11 11:27:39 +03:00
2019-08-13 18:33:36 +03:00
echo "Current email address: $_POOLS_PASS"
read -p "Enter new email address: " _POOLS_PASS
echo "_POOLS_PASS=\"$_POOLS_PASS\"" >> $_MYSETTINGS_FILE_LOCATION
2019-08-11 11:27:39 +03:00
fi
2019-08-11 16:58:07 +03:00
# Call function
load_mysettings
my_config_json
2019-08-11 11:27:39 +03:00
fi
2019-08-11 11:45:15 +03:00
2019-08-11 16:58:07 +03:00
echo "${_CYAN}USER SETTINGS STOPPED${_RESET}"