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:
parent
c586caffa7
commit
98a5f052a7
@ -78,7 +78,7 @@ if [ "${ADD_SWAP}" = true ]; then
|
|||||||
RESULT=$?
|
RESULT=$?
|
||||||
set -e
|
set -e
|
||||||
if [ $RESULT -eq 0 ]; then
|
if [ $RESULT -eq 0 ]; then
|
||||||
swapoff /swapfile && rm -f /swapfile
|
$SUDO swapoff /swapfile && $SUDO rm -f /swapfile
|
||||||
fi
|
fi
|
||||||
$SUDO dd if=/dev/zero of=/swapfile count=${SWAP_SIZE_GB}k bs=1M
|
$SUDO dd if=/dev/zero of=/swapfile count=${SWAP_SIZE_GB}k bs=1M
|
||||||
$SUDO chmod 0600 /swapfile
|
$SUDO chmod 0600 /swapfile
|
||||||
|
Loading…
x
Reference in New Issue
Block a user