infect: have swap usage optional (#91)

Doesn't work everywhere with swapon, e.g. osuosl openstack cluster.

Without swap it can succeed though, it's not a hard prerequisite for the
infection to take effect.
This commit is contained in:
Matthias Tafelmeier 2022-01-03 18:26:23 +01:00 committed by GitHub
parent 2ec52a0ede
commit 36e19e3b30
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -310,10 +310,14 @@ infect() {
checkEnv
prepareEnv
if [[ -z "$NO_SWAP" ]]; then
makeSwap # smallest (512MB) droplet needs extra memory!
fi
makeConf
infect
if [[ -z "$NO_SWAP" ]]; then
removeSwap
fi
if [[ -z "$NO_REBOOT" ]]; then
reboot