diff --git a/build_coin.sh b/build_coin.sh index 27257cc..0063bc9 100644 --- a/build_coin.sh +++ b/build_coin.sh @@ -148,7 +148,7 @@ gen=0 echo -e "Starting ${coind::-1}" /usr/bin/"${coind}" -datadir=$STORAGE_ROOT/wallets/."${coind::-1}" -conf="${coind::-1}.conf" -daemon -shrinkdebugfile -# Create easy daemon start file +Create easy daemon start file echo ''${coind}' -datadir=$STORAGE_ROOT/wallets/.'${coind::-1}' -conf='${coind::-1}'.conf -daemon -shrinkdebugfile ' | sudo -E tee /usr/bin/"${coin_symbol}_start" >/dev/null 2>&1 sudo chmod +x /usr/bin/"${coin_symbol}_start" diff --git a/nomp.sh b/nomp.sh index d4d00ea..5a5ca48 100644 --- a/nomp.sh +++ b/nomp.sh @@ -36,7 +36,7 @@ npm install -g pm2@latest >/dev/null 2>&1 echo -e " Are we there yet...$COL_RESET" npm install -g npm@latest >/dev/null 2>&1 echo -e " We have successfully hacked the NSA using this server...$COL_RESET" -echo -e " Just kidding, we hacked the White House...$COL_RESET" +echo -e "$GREEN Just kidding, we hacked the White House...$COL_RESET" # SED the config file sudo sed -i 's/domain_name/'$Domain_Name'/g' $STORAGE_ROOT/nomp/configuration/config.json @@ -45,9 +45,6 @@ sudo sed -i 's/PASSWORD/'$Admin_Pass'/g' $STORAGE_ROOT/nomp/configuration/config sudo sed -i 's/coin_name/'$coin_name'/g' $STORAGE_ROOT/nomp/configuration/config.json # Change to the coins config folder check for existing config, if not let the user know. -coin_no_coin=$coin_name -coin_no_coin=${coin_name//coin/} - if [ -f $STORAGE_ROOT/nomp/configuration/coins/${coin_name}.json ]; then echo -e " ${coin_name}.json created, release the hounds!" elif @@ -57,8 +54,9 @@ elif else sudo cp -r $STORAGE_ROOT/nomp/configuration/coins/default.json $STORAGE_ROOT/nomp/configuration/coins/$coin_name.json sudo sed -i 's/coin_name/'$coin_name'/g' $STORAGE_ROOT/nomp/configuration/coins/$coin_name.json - echo -e " You will need to edit $STORAGE_ROOT/nomp/configuration/coins/${coin_name}.json with additional information." - echo -e " Until you edit this file your pool will not start! Sorry not sorry..." + sudo sed -i 's/coin_symbol/'$coin_symbol'/g' $STORAGE_ROOT/nomp/configuration/coins/$coin_name.json + echo -e "$RED You will need to edit $STORAGE_ROOT/nomp/configuration/coins/${coin_name}.json with additional information.$COL_RESET" + echo -e "$RED Until you edit this file your pool will not work correctly! Sorry not sorry...$COL_RESET" fi # Create coin pool_config json file. diff --git a/questions.sh b/questions.sh index 85e8a33..9447808 100644 --- a/questions.sh +++ b/questions.sh @@ -89,7 +89,7 @@ Using_Sub_Domain=no Install_SSL=no fi -if [ -z "$Admin_Pass" ]; then +if [ -z "${Admin_Pass:-}" ]; then DEFAULT_Admin_Pass=$(openssl rand -base64 8 | tr -d "=+/") input_box "Admin Password" \ "Enter your new Admin password or use this randomly system generated one. @@ -104,7 +104,7 @@ exit fi fi -if [ -z "$Support_Email" ]; then +if [ -z "${Support_Email:-}" ]; then DEFAULT_Support_Email=root@localhost input_box "System Email" \ "Enter an email address for the system to send alerts and other important messages. @@ -120,7 +120,7 @@ fi # Get the coind info they want to build during install. -if [ -z "$coin_name" ]; then +if [ -z "${coin_name:-}" ]; then DEFAULT_coin_name=Bitcoin input_box "Coin Name" \ "Enter your coins proper name here. Do not use spaces. @@ -135,7 +135,21 @@ exit fi fi -if [ -z "$coin_repo" ]; then +if [ -z "${coin_symbol:-}" ]; then +DEFAULT_coin_symbol=BTC +input_box "Coin Symbol" \ +"Enter your coins symbol..Make sure to use all CAPS... +\n\nCoin Symbol:" \ +$DEFAULT_coin_symbol \ +coin_symbol + +if [ -z "$coin_symbol" ]; then +# user hit ESC/cancel +exit +fi +fi + +if [ -z "${coin_repo:-}" ]; then DEFAULT_coin_repo="https://github.com/bitcoin/bitcoin.git" input_box "Default Coin Repo" \ "Enter your coins repo to use.. @@ -196,6 +210,9 @@ fi # set the $coin_name variable to all lower case. coin_name=${coin_name,,} +# set the secondary json search without the word coin in it. +coin_no_coin=$coin_name +coin_no_coin=${coin_name//coin/} # Save the global options in $STORAGE_ROOT/yiimp/.yiimp.conf so that standalone # tools know where to look for data. @@ -212,6 +229,8 @@ Support_Email='"${Support_Email}"' Admin_Pass='"'"''"${Admin_Pass}"''"'"' coin_name='"'"''"${coin_name}"''"'"' +coin_symbol='"'"''"${coin_symbol}"''"'"' +coin_no_coin='"'"''"${coin_no_coin}"''"'"' # Unless you do some serious modifications this installer will not work with any other repo of nomp! YiiMPRepo='https://github.com/cryptopool-builders/cryptopool.builders-nomp-pool.git' diff --git a/server_cleanup.sh b/server_cleanup.sh index dbc4fd4..3b8c6bf 100644 --- a/server_cleanup.sh +++ b/server_cleanup.sh @@ -24,7 +24,7 @@ source /etc/multipool.conf # BTC Donation: 12Pt3vQhQpXvyzBd5qcoL17ouhNFyihyz5 # ################################################################################ -cd $STORAGE_ROOT/nomp/site +cd $STORAGE_ROOT/nomp/core screen -dmS nomp node init.js ' | sudo -E tee $STORAGE_ROOT/nomp/starts/nomp.start.sh >/dev/null 2>&1 sudo chmod +x $STORAGE_ROOT/nomp/starts/nomp.start.sh diff --git a/start.sh b/start.sh index 77300a2..727c0e7 100644 --- a/start.sh +++ b/start.sh @@ -64,8 +64,11 @@ source server_harden.sh source server_cleanup.sh clear -echo Installation of your NOMP single server is now completed. -echo You *MUST* reboot the machine to finalize the machine updates and folder permissions! NOMP will not function until a reboot is performed! +echo -e "Installation of your NOMP server is now completed." +echo -e "You $RED*MUST REBOOT*$COL_RESET the machine to finalize the machine updates and folder permissions! $MAGENTA NOMP will not function until a reboot is performed!$COL_RESET" echo +echo -e "$YELLOW If you are using the servers IP instead of a domain name you will be alerted that your website has an invalid certificate.$COL_RESET" echo -echo By default all stratum ports are blocked by the firewall. To allow a port through, from the command prompt type sudo ufw allow port number. +echo -e "$RED By default all stratum ports are blocked by the firewall.$COL_RESET To allow a port through, from the command prompt type $GREEN sudo ufw allow port number.$COL_RESET" + +exit 0