Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save KEINOS/a71475750b644b1c26db42870cfbafe5 to your computer and use it in GitHub Desktop.
Save KEINOS/a71475750b644b1c26db42870cfbafe5 to your computer and use it in GitHub Desktop.
Mondo Rescue Installer for CentOS7 at Sakura VPS.
#!/bin/bash
# HOW TO INSTALL
# Run below as root
# cd ~/ && wget -O install_mondorescue.sh https://gist.github.com/KEINOS/a71475750b644b1c26db42870cfbafe5/raw&&chmod 0755 install_mondorescue.sh && ./install_mondorescue.sh
# ---------------------------------
# Set screen width
# ---------------------------------
if [ -n "${TERM}" ]; then width=$(tput cols); else width=20; fi
width_half = ${width}/2;
# ---------------------------------
# Function to echo progress)
# ---------------------------------
echo_hr_full(){
printf -v _hr "%*s" ${width} && echo ${_hr// /${1--}}
}
echo_hr_half(){
printf -v _hr "%*s" ${width_half} && echo ${_hr// /${1--}}
}
echo_title(){
echo
echo
echo_hr_full =
echo " $1 $2"
echo_hr_full =
}
echo_subtitle(){
echo
echo_hr_half -
echo " $1 $2"
echo_hr_half -
}
install_rpm(){
echo_title "Installing RPM " $1
echo_subtitle "Downloading... " $1
sudo wget ${URI_INDEX}$1
echo_subtitle "Installing... " $1
sudo rpm -ivh $1
}
install_yum(){
echo_title "Installing YUM " $1
sudo yum -y install $1
}
# ---------------------------------
# Set Files and Directory names
# ---------------------------------
# Working directory
DNAME_TEMP=temp_mondorescue
# Download from
URI_INDEX=ftp://ftp.mondorescue.org/rhel/7/x86_64/
# Files to donwload
FNAME_RPM_PROJECTBUILDER=perl-ProjectBuilder-0.14.5-1.rhel7.noarch.rpm
FNAME_YUM_MONDO=mondo-3.2.2-1.rhel7.x86_64.rpm
FNAME_REPO_MONDO=mondorescue.repo
# ---------------------
# YUM Update
# ---------------------
echo_title "Updating" "YUM"
sudo yum -y update
echo "YUM update done."
# ---------------------
# Dependencies
# ---------------------
echo_title "Installing" "Dependencies"
cd ~/
install_rpm ${FNAME_RPM_PROJECTBUILDER}
install_yum lzop
#install_yum lzo
# ---------------------
# Mondo Rescue
# ---------------------
echo_title "Installing" "Mondo Rescue"
echo_subtitle "Downloading" "MondoRescue Repo file"
cd /etc/yum.repos.d/
wget ${URI_INDEX}${FNAME_REPO_MONDO}
echo_subtitle "Installing..." "mondo using repo"
yum -y --enablerepo=mondorescue install mondo
# ---------------------
# Working Directory
# ---------------------
cd ~/
#sudo mkdir ${DNAME_TEMP}
#cd ./${DNAME_TEMP}
echo DONE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment