1. Jakub Wilk
  2. sshpg

Commits

Jakub Wilk  committed d4ff7cc

Use /run/shm (instead of /dev/shm) if the former exists.

  • Participants
  • Parent commits 15c1518
  • Branches default

Comments (0)

Files changed (1)

File ssh

View file
  • Ignore whitespace
 # subversion sends SIGTERM to ssh. WTH?!
 trap '' TERM
 
+if [ -d /run/shm/ ]
+then
+    shm=/run/shm
+else
+    shm=/dev/shm
+fi
+
 lockfile="$HOME/.ssh/sshpg-lock"
 
 (
     if [ -z "$n" ]
     then
         n=0
-        lockcounter=$(mktemp /dev/shm/sshpg.XXXXXX)
+        lockcounter=$(mktemp $shm/sshpg.XXXXXX)
         ln -sf "$lockcounter" "${lockfile}.n"
     fi
     printf $((n+1)) > "${lockfile}.n"
         symlink="${gpg_key%.gpg}"
         if ! [ -s "$symlink" ]
         then
-            key=$(mktemp /dev/shm/sshpg.XXXXXX)
+            key=$(mktemp $shm/sshpg.XXXXXX)
             gpg --decrypt "$gpg_key" > "$key"
             ln -sf "$key" "$symlink"
         fi