Skip to content

Instantly share code, notes, and snippets.

@Enelar
Last active August 29, 2015 14:21
Show Gist options
  • Save Enelar/eb4e49b107ba94103b46 to your computer and use it in GitHub Desktop.
Save Enelar/eb4e49b107ba94103b46 to your computer and use it in GitHub Desktop.
Enable&autoload zram on fedora
#!/bin/bash
# http://mystilleef.blogspot.ru/2011/10/enable-zram-in-fedora.html
if [ `whoami` != "root" ]; then
echo "Sudo required"
exit
fi
RED='\033[0;31m'
NC='\033[0m' # No Color
printf "${RED}Check&install required utility${NC}\n"
rpmqa=`rpm -qa`
echo $rpmqa | grep -qw wget || sudo yum install wget
echo $rpmqa | grep -qw tar || sudo yum install tar
printf "${RED}Instailing scripts${NC}\n"
cd /usr/sbin
wget https://raw.githubusercontent.com/Enelar/FedoraZram/master/zramstart
wget https://raw.githubusercontent.com/Enelar/FedoraZram/master/zramstat
wget https://raw.githubusercontent.com/Enelar/FedoraZram/master/zramstop
chmod +x zramstart zramstat zramstop
printf "${RED}Instailing service${NC}\n"
cd /etc/systemd/system
wget https://raw.githubusercontent.com/Enelar/FedoraZram/master/mkzram.service
systemctl enable mkzram.service
systemctl start mkzram.service
systemctl status mkzram.service
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment