Add missing sudo for swap actions

The previous patch did not properly add sudo for the swapoff commands
when it is currently enabled.

Change-Id: I37c2ff9299a8ccff3f0c4f3eebb7d00d5cb5a7c3
This commit is contained in:
Alex Schultz 2017-10-18 08:24:10 -06:00
parent c586caffa7
commit 98a5f052a7

View File

@ -78,7 +78,7 @@ if [ "${ADD_SWAP}" = true ]; then
RESULT=$?
set -e
if [ $RESULT -eq 0 ]; then
swapoff /swapfile && rm -f /swapfile
$SUDO swapoff /swapfile && $SUDO rm -f /swapfile
fi
$SUDO dd if=/dev/zero of=/swapfile count=${SWAP_SIZE_GB}k bs=1M
$SUDO chmod 0600 /swapfile