support CentOS not Arch

This commit is contained in:
vdo 2022-05-26 15:43:42 +01:00
parent 7be8a6fb21
commit cfcf947e6f
No known key found for this signature in database
GPG key ID: F10AD1E5C08EA7E2
2 changed files with 23 additions and 9 deletions

View file

@ -1,2 +1,18 @@
# xmr.sh
A Monero node installer in a single command
Tested in:
- Debian 11
- Ubuntu Focal
- Fedora 36
- CentOS 10 Stream
ToDo:
[ ] Add wizard for DNS domain selection.
[ ] Status and node info at finish.
[ ] Make tor service optional
[ ] Optional block explorer
[ ] Grafana with stats

View file

@ -103,9 +103,7 @@ install_pkg() {
if grep -q "debian" /etc/os-release; then
apt-get update >>"${XMRSH_LOG_FILE}" 2>&1
apt-get install -y $1 >>"${XMRSH_LOG_FILE}" 2>&1
elif grep -q "arch" /etc/os-release; then
pacman -Sy --noconfirm $1 >>"${XMRSH_LOG_FILE}" 2>&1
elif grep -q "fedora" /etc/os-release; then
elif grep -q "fedora" /etc/os-release || grep -q "centos" /etc/os-release; then
dnf install -y $1 >>"${XMRSH_LOG_FILE}" 2>&1
else
echo -e "${ErrBullet}Cannot detect your distribution package manager.${Off}"
@ -152,8 +150,8 @@ install_docker() { (
# Docker Installer as provided in
curl -fsSL https://get.docker.com -o - | bash >>"${XMRSH_LOG_FILE}" 2>&1
check_return $?
# Fedora and Arch need to enable & start the daemon
if grep -q "fedora" /etc/os-release || grep -q "arch" /etc/os-release; then
# Fedora and Centos need to enable & start the daemon
if grep -q "fedora" /etc/os-release || grep -q "centos" /etc/os-release; then
systemctl enable docker
systemctl start docker >>"${XMRSH_LOG_FILE}" 2>&1
fi
@ -196,13 +194,13 @@ start_xmrsh() {
start_xmrsh_tor() {
pushd "${XMRSH_DIR}" >>"${XMRSH_LOG_FILE}" 2>&1
"${OkBullet}Starting tor hidden service... ${Off}"
echo -ne "${OkBullet}Starting tor hidden service... ${Off}"
docker-compose -f docker-compose.yml -f docker-compose.tor.yml up -d >>"${XMRSH_LOG_FILE}" 2>&1
check_return $?
sleep 3
ONION=$(docker logs tor 2>&1 | grep Entrypoint | cut -d " " -f 1)
ONION=$(docker logs tor 2>&1 | grep Entrypoint | cut -d " " -f 8)
echo -e "${Ok}"
"${OkBullet}Tor hidden service ready at: ${ONION} ${Off}"
echo -e "${OkBullet}Tor hidden service ready at: ${ONION} ${Off}"
}
check_return() {
@ -215,7 +213,7 @@ check_return() {
completed() {
# FIXME: Show domain / public IP
"${OkBullet}Deployment complete!!${Off}"
echo -e "${OkBullet}Deployment complete!!${Off}"
}
header