home *** CD-ROM | disk | FTP | other *** search
/ Clickx 115 / Clickx 115.iso / software / tools / windows / tails-i386-0.16.iso / live / filesystem.squashfs / lib / init / swap-functions.sh < prev    next >
Encoding:
Text File  |  2012-03-27  |  721 b   |  29 lines

  1. #
  2. # Functions that assist in turning on swap.
  3. #
  4.  
  5. # $1 is a string used to log the type of swap expected to be activated
  6. swaponagain() {
  7.     #
  8.     # Execute swapon command again to pick up any swap partitions
  9.     # that have shown up since the last swapon.
  10.     #
  11.     # Ignore 255 status due to swap already being enabled
  12.     #
  13.     if [ "$NOSWAP" = yes ]
  14.     then
  15.         [ "$VERBOSE" = no ] || log_warning_msg "Not activating swap as requested via bootoption noswap."
  16.     else
  17.         if [ "$VERBOSE" = no ]
  18.         then
  19.             log_action_begin_msg "Activating $1 swap"
  20.             swapon -a -e 2>/dev/null || :  # Stifle "Device or resource busy"
  21.             log_action_end_msg 0
  22.         else
  23.             log_daemon_msg "Will now activate $1 swap"
  24.             swapon -a -e -v
  25.             log_action_end_msg $?
  26.         fi
  27.     fi
  28. }
  29.