Skip to content
Snippets Groups Projects
freebsd.sh 678 B
Newer Older
  • Learn to ignore specific revisions
  • Jason A. Donenfeld's avatar
    Jason A. Donenfeld committed
    # Copyright (C) 2012 Jonathan Chu <milki@rescomp.berkeley.edu>. All Rights Reserved.
    # This file is licensed under the GPLv2+. Please see COPYING for more information.
    
    
    Jonathan Chu's avatar
    Jonathan Chu committed
    tmpdir() {
    
    Jason A. Donenfeld's avatar
    Jason A. Donenfeld committed
    	ramdisk="/var/tmp/password-store.ramdisk"
    	if [[ -d $ramdisk && -d $ramdisk && -d $ramdisk ]]; then
    
    Jonathan Chu's avatar
    Jonathan Chu committed
    		tmp_dir="$(TMPDIR=$ramdisk mktemp -t "$template" -d)"
    	else
    
    Jason A. Donenfeld's avatar
    Jason A. Donenfeld committed
    		yesno "$(echo    "A ramdisk does not exist at $ramdisk, which means that it may"
    			 echo    "be difficult to entirely erase the temporary non-encrypted"
    			 echo    "password file after editing. Are you sure you would like to"
    			 echo -n "continue?")"
    
    Jonathan Chu's avatar
    Jonathan Chu committed
    
    		tmp_dir="$(mktemp -t "$template" -d)"
    	fi
    }
    
    GETOPT="/usr/local/bin/getopt"