xmrig-bash-scripts/install.sh

74 lines
1.1 KiB
Bash
Raw Normal View History

#!/bin/bash
2019-08-11 16:58:07 +03:00
# Colors
_CYAN=`tput setaf 1`
_GREEN=`tput setaf 2`
_YELLOW=`tput setaf 3`
_BLUE=`tput setaf 4`
_MAGENTA=`tput setaf 5`
_CYAN=`tput setaf 6`
_RESET=`tput sgr0`
echo "${_GREEN}INSTALLATION STARTED${_RESET}"
_DEBUG=$1
2019-08-10 18:27:01 +03:00
if $_DEBUG; then
set +x
else
set -x
2019-08-10 18:27:01 +03:00
fi
2019-08-05 22:49:49 +03:00
2019-08-10 18:27:01 +03:00
# Set that user passwdless sudo
2019-08-05 22:49:49 +03:00
if sudo grep -q $USER /etc/sudoers.d/README; then
echo -e "User $USER found in /etc/sudoers.d/README. All good!!\n"
else
echo -e "$USER does not have passwdles sudo. Fixing that!!\n"
echo "$USER ALL=(ALL) NOPASSWD:ALL" | sudo tee -a /etc/sudoers.d/README
fi
2019-08-10 18:27:01 +03:00
# Load functions
. functions.sh
2019-08-11 16:58:07 +03:00
sleep 5
2019-08-10 18:27:01 +03:00
# Get settings
. settings.sh
2019-08-11 11:27:39 +03:00
sleep 5
2019-07-27 13:00:13 +03:00
# Update system
. maintenance.sh
sleep 5
# Install dependencies
. depends.sh
sleep 5
2019-08-12 21:08:42 +03:00
# User input
. input.sh
sleep 5
# Stop running instance
. stop.sh
# Get source and build by sourcing our build file
. build.sh
sleep 5
2019-07-27 22:13:23 +03:00
# Create a config.json
. config.sh
sleep 5
# Setup crontab for user
. crontab.sh
sleep 5
# Unset REPO variable so start script will execute program
SCREEN=""
# Start mining
. start.sh
echo -e "${_CYAN}INSTALLATION COMPLETED${_RESET}"