Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save msnoigrs/dffaef78e0471d01d4522123840de4a4 to your computer and use it in GitHub Desktop.
Save msnoigrs/dffaef78e0471d01d4522123840de4a4 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