summaryrefslogtreecommitdiff
path: root/sysutils/password-store/files/linuxism.patch
blob: 24b69ba078d6608ea208a309e8344dc1e22241b2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
diff --git src/password-store.sh src/password-store.sh
index 26a4bd0..4e0526d 100755
--- src/password-store.sh
+++ src/password-store.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/local/bin/bash
 
 # Copyright (C) 2012 Jason A. Donenfeld <Jason@zx2c4.com>. All Rights Reserved.
 # This file is licensed under the GPLv2+. Please see COPYING for more information.
@@ -108,20 +108,20 @@ clip() {
 	echo "Copied $2 to clipboard. Will clear in 45 seconds."
 }
 tmpdir() {
-	if [[ -d /dev/shm && -w /dev/shm && -x /dev/shm ]]; then
-		tmp_dir="$(TMPDIR=/dev/shm mktemp -t "$template" -d)"
+	ramdisk="/var/tmp/password-store.ramdisk"
+	if [[ -d $ramdisk && -d $ramdisk && -d $ramdisk ]]; then
+		tmp_dir="$(TMPDIR=$ramdisk mktemp -t "$template" -d)"
 	else
-		yesno "$(echo    "Your system does not have /dev/shm, 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?")"
+		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?")"
+
 		tmp_dir="$(mktemp -t "$template" -d)"
 	fi
-
 }
-GETOPT="getopt"
 
-# source /path/to/platform-defined-functions
+GETOPT="/usr/local/bin/getopt"
 #
 # END Platform definable
 #