Explorar el Código

Ensure TMPDIR is set before we use it. It *should* be, but sometimes under cron it is not, so double-check and add a default if the detection fails

Zachary Kotlarek hace 13 años
padre
commit
669708a24d
Se han modificado 1 ficheros con 12 adiciones y 0 borrados
  1. 12 0
      mountMedia

+ 12 - 0
mountMedia

@@ -1,5 +1,17 @@
 #!/bin/bash
 
+# Ensure we have a valid TMPDIR
+if [ ! -d "${TMPDIR}" ]; then
+        TMPDIR="`getconf DARWIN_USER_TEMP_DIR 2>/dev/null`"
+        if [ ! -d "${TMPDIR}" ]; then
+                TMPDIR="/var/tmp"
+        fi
+        if [ ! -d "${TMPDIR}" ]; then
+                TMPDIR="/tmp"
+        fi
+fi
+
+# Config
 HOST="vera.uberzach.com"
 LOCK="${TMPDIR}/mountMedia.mounting"