This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
if [[ ! -f /etc/yum.repos.d/elrepo.repo ]] | |
then | |
rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org | |
rpm -Uvh https://elrepo.org/linux/kernel/el7/x86_64/RPMS/elrepo-release-7.0-4.el7.elrepo.noarch.rpm | |
sed '35,47s/enabled=0/enabled=1/' /etc/yum.repos.d/elrepo.repo > /tmp/elrepo.repo | |
cp /etc/yum.repos.d/elrepo.repo /etc/yum.repos.d/elrepo.repo.bak |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
if (( EUID != 0 )) | |
then | |
echo "Script should be run as root" | |
exit 1 | |
else | |
echo "Detected running as root" | |
fi |