Created
April 6, 2017 10:43
-
-
Save naota/3df59b3fa7ed318f2fb45acb5b57d045 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
#!/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