Skip to content

Instantly share code, notes, and snippets.

@naota
Created April 6, 2017 10:43
Show Gist options
  • Save naota/3df59b3fa7ed318f2fb45acb5b57d045 to your computer and use it in GitHub Desktop.
Save naota/3df59b3fa7ed318f2fb45acb5b57d045 to your computer and use it in GitHub Desktop.
#!/bin/bash
CPUQuota=90
CPUWeight=50
MemoryMax=
EMERGE=$HOME/bin/autoemerge
props=
if [ -n "${CPUQuota}" ]; then
props+="-p CPUQuota=${CPUQuota}% "
fi
if [ -n "${CPUQuota}" ]; then
props+="-p CPUWeight=${CPUWeight} "
fi
if [ -n "${MemoryMax}" ]; then
props+="-p MemoryMax=${MemoryMax} "
fi
sudo eix-sync || exit
pkgs=$(eix -u --selected --compact | peco | awk '{print $2}')
echo Install ${pkgs}
sudo systemd-run --scope ${props} ${EMERGE} -1avt -j2 ${pkgs}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment