Skip to content

Commit

Permalink
New NOMP installer code
Browse files Browse the repository at this point in the history
New NOMP installer code
  • Loading branch information
cryptopool-builders committed Dec 9, 2019
1 parent 684c7a3 commit 2546a01
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 15 deletions.
2 changes: 1 addition & 1 deletion build_coin.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
10 changes: 4 additions & 6 deletions nomp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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.
Expand Down
27 changes: 23 additions & 4 deletions questions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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.
Expand All @@ -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.
Expand All @@ -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..
Expand Down Expand Up @@ -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.
Expand All @@ -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'
Expand Down
2 changes: 1 addition & 1 deletion server_cleanup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 6 additions & 3 deletions start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 2546a01

Please sign in to comment.