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
1 changed files with 6 additions and 2 deletions

View File

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