This repository was archived by the owner on Jan 16, 2024. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -21,15 +21,34 @@ if [ "$1" != 'local' ] ; then
2121 exit 0
2222fi
2323
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+
2439activate_swaps_linux () {
2540 SWAP_DRIVES=$( blkid -t TYPE=" swap" -o device)
2641 for SWAP in $SWAP_DRIVES ; do
2742 if [ -z " $( swapon -s | grep $SWAP ) " ]; then
28- swapon $SWAP
43+ swapon " $SWAP "
2944 fi
3045 done
3146}
3247
33- if [ " $( uname -s) " = ' Linux' ] && [ " ${DISABLE_SWAP} " != " true" ]; then
48+ if is_true " ${IGNORE_SWAP} " ; then
49+ exit 0
50+ fi
51+
52+ if [ " $( uname -s) " = ' Linux' ]; then
3453 activate_swaps_linux
3554fi
You can’t perform that action at this time.
0 commit comments