We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 6c18bfb + 0831bdf commit 3dcc05aCopy full SHA for 3dcc05a
1 file changed
src/etc/one-context.d/loc-14-mount-swap##one
@@ -21,15 +21,34 @@ if [ "$1" != 'local' ] ; then
21
exit 0
22
fi
23
24
+# arg: <true|yes|false|no>
25
+is_true()
26
+(
27
+ _value=$(echo "$1" | \
28
+ sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//' | \
29
+ tr '[:upper:]' '[:lower:]')
30
+ case "$_value" in
31
+ 1|true|yes|y)
32
+ return 0
33
+ ;;
34
+ esac
35
+
36
+ return 1
37
+)
38
39
activate_swaps_linux() {
40
SWAP_DRIVES=$(blkid -t TYPE="swap" -o device)
41
for SWAP in $SWAP_DRIVES ; do
42
if [ -z "$(swapon -s | grep $SWAP)" ]; then
- swapon $SWAP
43
+ swapon "$SWAP"
44
45
done
46
}
47
48
+if is_true "${IGNORE_SWAP}" ; then
49
+ exit 0
50
+fi
51
52
if [ "$(uname -s)" = 'Linux' ]; then
53
activate_swaps_linux
54
0 commit comments